Hi!
I have been trying to code this for 6 days.
Playing from a File or Stream
MediaPlayer mp = new MediaPlayer();
mp.setDataSource(PATH_TO_FILE);
mp.prepare();
mp.start();
my code...
package info.shouraig.com;
import android.app.Activity;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
import android.widget.MediaController;
import android.widget.VideoView;
public class XSO6 extends Activity {
private final static String RTSP = "rtsp://v4.cache2.c.youtube.com/
http://www.youtube.com/watch?v=8bmWwxixT0Y";
VideoView VideoViewXSO6;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
//***VideoView to video element inside Multimedia.xml file
VideoView videoView =(VideoView)findViewById
(R.id.VideoViewXSO6);
Log.v("videoViewXSO6", "***Video to Play:: " + RTSP);
MediaController mc = new MediaController(this);
mc.setAnchorView(videoView);
Uri video = Uri.parse(RTSP);
videoView.setMediaController(mc);
videoView.setVideoURI(video);
videoView.start();
}
}
and still.. the error message in the emulator reads... "sorry this
video cannot be played"
is there something i need to do or not do in order to stream this
video from Youtube"..
TIA
cheers
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en