开发者

Sharing VideoView between two MediaPlayers not working

I have one main MediaPlayer which plays nicely an RTSP stream and I have used an AsyncTask to buffer the开发者_JAVA技巧 content of another stream. It achieves this. When I try to switch to the second stream, I can hear that the stream switched and it doesn't lag, but I only get sound. The SurfaceHolder holds a VideoView, it has been prepared, I registered it as Display for both mediaplayers. When I switch streams, I stop the old MediaPlayer but the surface doesn't get destroyed, which is good, but it doesn't display my second video. Any ideas?


Could you supply your VideoView instantiation code and the code you use to switch out the MediaPlayers?

In any case, I doubt this will work well because the VideoView instantiates its own MediaPlayer and uses it to play media. (see VideoView.java)

You would probably need to switch out the VideoView itself, or build a replacement for the VideoView using your own subclass of SurfaceView.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜