处理两个表面视图
我有两个表面视图 1> MediaRecorder 显示表面视图。 2> MediaPlayer SurfaceView 显示由 MediaRecorder 录制的媒体。
我想在 z 排序的屏幕上同时显示两个视图。
mediaPlayer 将全屏播放,MediaRecorderPreview shd 将出现在右上角,但尺寸较小。
我可以使用两个表面来执行此操作,但问题是 MediaRecorder 预览始终转到背景 z 顺序并被媒体播放器全屏显示隐藏。
他们有什么方法来定义 Surface View 的 Z 顺序吗?
或者我可以做任何其他的suzzestion来完成这项工作。我可以在一个界面中同时启动 MediaRecorder 和 MediaPlayer 吗?
请建议。谢谢!!
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 palying 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!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
从 Android 2(API 级别 5)开始,支持 2 个表面视图。您可以使用 setZOrderMediaOverlay< 设置 2 个表面视图的 zOrder /a> 尽管显然它破坏了 SurfaceView 的预期语义。
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.
AFAIK,Android 不支持。 Android 无法合成多个 SurfaceView。它可以处理
SurfaceView
之上的常规View
(例如Button
),但不能处理两个SurfaceView
Z订购了。我建议重新设计您的应用程序,使其一次只有一个
SurfaceView
。AFAIK, that is not supported by Android. Android cannot composite multiple
SurfaceViews
. It can handle a regularView
(e.g.,Button
) on top of aSurfaceView
, but not twoSurfaceViews
Z ordered.I recommend redesigning your application to have a single
SurfaceView
at a time.