I'm trying play a video stream with MediaPlayer
in a new Activity
after the buffering was completed in background. Why another Activity
? It's a part of a video playback library, and the video has to overlay the user's app, no matter what layout is currently active.
My idea is to create a MediaPlayer
object, start buffering (with prepare
method) and after the buffering is complete start a new Activity
with a SurfaceView
for showing the video. In the new Activity
I assign the SurfaceHolder
of the SurfaceView
to the MediaPlayer
(with setDisplay
method) and initiate playback, without success: I see the SurfaceView
without the video playback.
I think, the problem is that the MediaPlayer's
prepare
method expects, that the SurfaceHolder
was set with the setDisplay
method before it.
Any ideas to get this setup working?