SurfaceView叠加展示

在集成网易云信视频通讯SDK时遇到SurfaceView覆盖问题,本地小窗画面被远端全屏画面覆盖。解决方案是利用SurfaceView的setZOrderMediaOverlay(boolean isMediaOverlay)方法,在添加SurfaceView到布局后设置其叠加状态,确保本地小窗显示在远端画面之上。
摘要由CSDN通过智能技术生成

SurfaceView叠加展示

项目背景

  最近集成网易云信的视频通讯SDK,碰到了一个问题。
  画面展示用的是云信封装的SurfaceView,直接在布局中使用。结果绘制画面的时候总是出现覆盖问题。
  PS:本地画面小窗展示(覆盖在远端界面之上),远端画面全屏展示。绘制远端画面的时候,本地小窗直接被覆盖。

解决方案

  谷歌了一下“SurfaceView叠加”关键字。很多资料都提到了SurfaceView的setZOrderMediaOverlay(boolean isMediaOverlay)方法。于是去源码中看了一下关于这个方法的描述:
* Control whether the surface view’s surface is placed on top of another
* regular surface view in the window (but still behind the window itself).
* This is typically used to place overlays on top of an underlying media
* surface view.
*
*

Note that this must be set before the surface view’s containing
* window is attached to the window manager.
*
*

Calling this overrides any previous call to {@link #setZOrderOnTop}.

大概翻译一下就是࿱

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值