微信小程序live-player直播,全屏安卓机不兼容问题解决


live-player官方文档:

https://developers.weixin.qq.com/miniprogram/dev/component/live-player.html

<live-player src="https://domain/pull_stream" mode="RTC" autoplay bindstatechange="statechange" binderror="error" style="width: 300px; height: 225px;" />

由于原生组件的限制,所以也没中无论设置多少z-index都无法覆盖原生组件。

cover-view官方文档:

https://developers.weixin.qq.com/miniprogram/dev/component/cover-view.html

 

此时通过cover-view增加全屏的入口,此时会发现IOS全屏正常,安卓手机全屏不正常。

正常情况:全屏后,任然有【退出全屏】

 

 

不正常情况:全屏后,没有【退出全屏】

 

 

解决方法:

live-player双标记标签,里面嵌套cover-view即可。
     <live-player id="player" src="{{liveUrl}}" mode="RTC" autoplay bindstatechange="statechange" binderror="error">
      <cover-view class="exit-full-img">
        <cover-view wx:if="{{fullScreenFlag}}" bindtap="quitFullScreen">
          <button type="primary">退出全屏</button>
        </cover-view>
        <cover-view wx:else bindtap="fullScreen">
          <button type="primary">全屏</button>
        </cover-view>
      </cover-view>
    </live-player>

 来源:https://blog.csdn.net/u010598111/article/details/83899727


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM