tags:

views:

47

answers:

1

Hi

I 've set Wowza streaming server to stream mp4 videos to Android phones. Android phone can play the RTSP stream successfully but here It only plays audio of the file not the video.

+1  A: 

Did you set surface (VideoView or SurfaceView) on which you would like to display video? You have to run setDisplay before running playback.

Problems with video can also be caused by starting playback too early. You should start player after surface is created. If you want to start playback at start of the Activity, you should do it on surfaceCreated event. You can listen to this event by implementing SurfaceHolder.Callback

Can you provide some source codes?

You can also try to follow Android ApiDemos. Video streaming player example can be found at:

...android-sdk-windows\platforms\android-x\samples\ApiDemos\src\com\example\android\apis\media\MediaPlayerDemo_Video.java
darbat
Thanks .. darbat Sure I will implement the methods suggested by you. And provide the source codes.
success_anil
Followed the suggested example by darbat but still the only the audio is getting played no video is getting displayed. // Create a new media player and set the listeners mMediaPlayer = new MediaPlayer(); /// here I 'm setting RTSP url to video mMediaPlayer.setDataSource(path); mMediaPlayer.setDisplay(holder); mMediaPlayer.prepare(); mMediaPlayer.setOnBufferingUpdateListener(this); mMediaPlayer.setOnCompletionListener(this);
success_anil
Can you show how do you define **holder**?
darbat