tags:

views:

57

answers:

3

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

A: 

You can use Intents to run start the native YouTube app on the phone. Read more here: http://stackoverflow.com/questions/574195/android-youtube-app-play-video-intent

TuomasR
I don't want to use intents. I want to play the video directly from the virtual server on android. Thankyou
Maxood
So you want to play the video inside your app? Using an Intent will play the video directly from the server.
Janusz
I want to play it from the server. Is it only possible through intents?
Maxood
+1  A: 

If you do want to use a private server, you can just use Anroid'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.

TuomasR
A: 

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();
    }
}
Maxood
Most 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
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/
Maxood