views:

294

answers:

0

I'm working with the media player on a streaming application (RTSP):

Video and sound are played great but when an incoming call pauses the Activity, the Surface is destroyed (I know this because of traces in SurfaceHolder.Callback).

Once the call finishes, the activity is resumed and a new Surface is created. I've tried to assign it to the player via setDisplay(SurfaceHolder sh) method but so far, only the sound of the video can be heard.

The work around to resume a video stream is:

  • Restart the MediaPlayer object.
  • Wait for the buffer to fill.
  • Perform a seek via the mediaPlayer.
  • Wait for the buffer to fill.

This is annoying as the player should be able to be paused when a call is received, bind the new surface when the call completed and the Activity resume and play the video with no buffering at all.