Handling two surface screens

I have two kinds of surface 1> View MediaRecorder images. 2> MediaPlayer SurfaceView displaying media recorded by MediaRecorder.

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

MediaPlayer will scale in full screen mode, and MediaRecorderPreview shd will appear in the upper right corner with a smaller size.

I can do this using two surfaces, but the problem is that the MediaRecorder preview always goes in the background z order and hides the media player all over the screen.

Is there any way to determine the order of the Z Surface View.

Or is it any other judgment I can make to make this work. Can I run MediaRecorder and MediaPlayer on the same surface?

Offer Pls. Thank!!

+3
source share
2 answers

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

AFAIK, which is not supported by Android. Android cannot combine several SurfaceViews. It can handle regular View(e.g. Button) on top SurfaceView, but not the two SurfaceViewsZ ordered.

I recommend redoing your application one SurfaceViewat a time.

+3
source

As of Android 2 (API level 5), supporting 2 surface views. You can set zOrder from 2 surfaces using setZOrderMediaOverlay , although it seems to break the supposed semantics of SurfaceView .

+1

Source: https://habr.com/ru/post/1781890/


All Articles