views:

46

answers:

1

There is an online stream that is 512Kb MPEG4 and total size of 312mb online and if I'm correct after looking over docs in order to play the movie I just simply put:

MediaPlayer mp = new MediaPlayer();
Try{
  mp.setDataSource("http://site.com/movie.mp4");
}
Try {
  mp.prepare();
}
mp.start();

It is triggered to play after a button press which after a few seconds after pressing the button it plays the audio BUT doesn't show the video, why not? Do I have to use a surface view or something for visual playback of the stream (the android docs don't seem to help me much)?

A: 

First, yes, you need a SurfaceView to play back video with a MediaPlayer. Or, use a VideoView and skip the MediaPlayer.

Second, if you are trying to play this back in the emulator, this is typical behavior. Video playback will not work well on the emulator unless you have crazy-fast hardware. I recommend that video player development be done with actual Android devices.

CommonsWare
Thanks for the quick answer mate.
CodeJustin.com