Two SurfaceHolders in one Activity
I want to play one RTSP stream in a surfaceView while I prepare the other in a separate thread. However, the MediaPlayer does give an error when instantiating two SurfaceHolders:
Command PLAYER_PREPARE completed with an error or info PVMFErrResource
Despite this, the video gets buffered, but when I switch to it, only audio is played. In the Android docs it is stated that this is a consequence of not calling setDisplay(SurfaceHolder) but this is what开发者_如何学编程 causes the error. Does anyone have any idea how I can make the video part of the stream show and how to avoid the error when calling setDisplay? Is this a platform limitation? Thanks.
Maybe you could put two separate SurfaceView
s inside (for example) FrameLayout
. Use these with two separate MediaPlayer
s and show/hide (in parallel to stoping/starting video) SurfaceView
you desire at given moment (using android:visibility
set to GONE
for example).
精彩评论