I have about 3 videos that i cannot install with my app on DROID due to their huge size. Now we have decided to host them on a private server or YouTube. How can i run these videos in Android? Thank you
3 Answers
If you do want to use a private server, you can just use Android's media features, playing a video with them is pretty simple if you have it in the proper format:
http://developer.android.com/guide/topics/media/index.html
Look especially at "Playing from a File or Stream". You can use setDataSource of the MediaPlayer to point to a remote location:
myMediaPlayer.setDataSource(myContext, "http://www.example.com/myVideo.3gp");
If you do choose to use YouTube, the problem is that the native format of YouTube is FLV which I don't think the MediaPlayer supports (as Flash support isn't completely available on Android, even with the install of the Flash Player, someone correct me if I'm wrong). YouTube does provide mobile versions, but the resolution is really poor and does not really suit high-end Android devices. There are versions for iPhone and Android apparently (for the native app), but I haven't found a way to get the URL.
Your best bet is with a private server.

- 6,487
- 3
- 39
- 47

- 2,296
- 18
- 28
You can use Intents to run start the native YouTube app on the phone. Read more here: Android YouTube app Play Video Intent
-
I don't want to use intents. I want to play the video directly from the virtual server on android. Thankyou – Muhammad Maqsoodur Rehman Sep 29 '10 at 06:25
-
So you want to play the video inside your app? Using an Intent will play the video directly from the server. – Janusz Sep 29 '10 at 07:17
-
I want to play it from the server. Is it only possible through intents? – Muhammad Maqsoodur Rehman Sep 29 '10 at 08:03
I have this code here and am getting the message: "This Video Cannot Be Played". Why?
package com.feelsocial.games.androidskillz;
import android.app.Activity;
import android.net.Uri;
import android.os.Bundle;
import android.widget.MediaController;
import android.widget.VideoView;
public class AndroidSkillz extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
VideoView video = (VideoView)findViewById(R.id.VideoView01);
Uri uri = Uri.parse("http://developer.avenuesocial.com/maxood.mov");
MediaController mc = new MediaController(this);
video.setMediaController(mc);
video.setVideoURI(uri);
video.start();
}
}

- 33,681
- 34
- 84
- 124
-
1Most likely the video is in a format that the phone cannot support. MOV is, IIRC, not a supported format. The currently supported video formats are H.263 and MPEG-4 SP. – TuomasR Sep 29 '10 at 08:12
-
Ok i have this software called "Handbrake", "Handbrake" can be downloaded from: http://handbrake.fr/downloads.php.I'm using to convert them into the format and following this article here to run it on DROID: http://www.funtechtalk.com/motorola-droid-best-video-format-conversion-settings-using-free-handbrake/ – Muhammad Maqsoodur Rehman Sep 29 '10 at 14:42