开发者

Handling two surfaceViews

I have two surface Views 1> MediaRecorder display surfaceview. 2> MediaPlayer SurfaceView displaying the Media recorded by MediaRecorder.

I want to display both the views simultaneously on the screen z ordered.

The mediaPlayer will be paly开发者_StackOverflowing in full screen and the MediaRecorderPreview shd appear in the top right corner with some smaller size.

I am able to do this using two surfaces but the issue is that the MediaRecorder Preview always goes to the background z order and gets hidden by the mediaplayer full screen display.

Is their any way to define the Z order of Surface View.

Or is their any other suzzestion i can do to make this work. Can i start both MediaRecorder and MediaPlayer in a single surface?

Pls suggest. Thanks!!


I want to display both the views simultaneously on the screen z ordered.

AFAIK, that is not supported by Android. Android cannot composite multiple SurfaceViews. It can handle a regular View (e.g., Button) on top of a SurfaceView, but not two SurfaceViews Z ordered.

I recommend redesigning your application to have a single SurfaceView at a time.


As of Android 2 (API level 5) having 2 surfaceviews is supported. You can set the zOrder of the 2 surface views using setZOrderMediaOverlay although apparently it breaks the intended semantics of SurfaceView.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜