Hi.. Your code is correct..!!
but your media is in .mov format.. In emulator, only 3gp format will be playing and may not play .mov or .mkv format. In real device you may possible to play videos... Another suggestion is try to play it in emulator. because H.264,H.263 media can be played in android. I think some sort of media encoding or conversion will be there.. check it.. On Sun, Apr 1, 2012 at 5:53 AM, Doug <[email protected]> wrote: > Does your app have internet permissions to do streaming (required in > ICS)? Is the video codec supported by your device? > > Doug > > On Tuesday, March 27, 2012 6:25:56 AM UTC-7, aglasofmilk wrote: >> >> Hi! I have a problem with playing videos through mediaplayer. I have a >> sound but no video. I was searching a lot of thread but can't find >> solve for my problem. Is is something wrong with the code? Or is it >> something else. Here's the code: >> >> public class TestStream1 extends Activity implements Callback{ >> MediaPlayer mMediaPlayer; >> String SrcPath = "rtsp://184.72.239.149/vod/ >> mp4:BigBuckBunny_175k.mov<http://184.72.239.149/vod/mp4:BigBuckBunny_175k.mov>"; >> >> private SurfaceView mPreview; >> private SurfaceHolder holder; >> @Override >> public void onCreate(Bundle savedInstanceState) { >> super.onCreate(**savedInstanceState); >> setContentView(R.layout.main); >> >> mPreview = (SurfaceView) findViewById(R.id.myvideoview)**; >> holder = mPreview.getHolder(); >> holder.addCallback(**TestStream1.this); >> holder.setType(SurfaceHolder.**SURFACE_TYPE_PUSH_BUFFERS); >> >> holder.setFixedSize(400,300); >> mMediaPlayer = new MediaPlayer(); >> try{ >> mMediaPlayer.setDataSource(**SrcPath); >> mMediaPlayer.setDisplay(**holder); >> mMediaPlayer.prepare(); >> mMediaPlayer.**setAudioStreamType(**AudioManager.STREAM_MUSIC); >> >> mMediaPlayer.start(); >> >> }catch(Exception e){ >> Toast .makeText( TestStream1.this, "Fail", >> Toast.LENGTH_LONG).show(); >> } >> >> } >> } > > -- > 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 -- 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

