小程序
小游戏
企业微信
微信支付
扫描小程序码分享
live-player层级比live-pusher层级高
2 个回答
加粗
标红
插入代码
插入链接
插入图片
上传视频
live-player和live-pusher:
1: live-player 绝对定位absolute占满屏幕
2:都用wx:if 控制显示就ok
<
view
wx:if
=
"{{!isCalling}}"
class
'fullscreen'
>
'video-wrapper'
live-player
id
"yunxin-player"
"{{playerUrl}}"
src
mode
"RTC"
autoplay
min-cache
"{{0.1}}"
max-cache
"{{0.3}}"
@
statechange
"statechangeplayer"
error
"errorplayer"
style
"position: absolute; width: 100%; height: 100vh; top: 0; left: 0;background-color: transparent;"
cover-view
'control-wrapper'
'netcall-time-text'
>{{duration}}</
cover-image
"item"
"/assets/img/yunxin/netcall-revert-camera.png"
tap.stop
"switchCameraHandler"
>切摄像头</
"/assets/img/yunxin/netcall-camera{{enableCamera ? '' : '-close'}}.png"
data-mode
"1"
"switchMeetingModeHandler"
>关闭摄像头</
"/assets/img/yunxin/netcall-micro{{muted ? '-close' : ''}}.png"
"2"
>关闭麦克风</
"/assets/img/yunxin/netcall-reject.png"
"hangupHandler"
>挂断</
</
live-pusher
"yunxin-pusher"
url
"{{userlist[0].url}}"
autopush @
"statechangepusher"
netstatus
"netstatus"
enable-camera
"{{enableCamera}}"
muted
"{{muted}}"
"width: 100px; height: 150px;right: -260px;top: 30px;"
/>
附上代码片段(网易云音视频通讯demo)
3.推流地址一开始就获取到了,但是拉流地址要等人接进来才有。故当playerUrl存在的时候显示live-player和live-pusher即可实现
你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。
你好,请具体描述问题。
现在想要实现一个双向视频的功能,其中主画面是 live-player主键,占整个手机屏幕.live-pusher是次画面,放在屏幕的右下角,并且显示层级比live-player高,覆盖在live-player上面.经过测试,发现这个2个原生组件的层级永远是live-player比较高,live-pusher会被完全遮挡住.
想请教下有没有方法调整这2个组件之间的显示层级?
大神你好
wx.getBackgroundAudioManager()
现在线上 锁屏时能播放 线下 开发版和体验版都不能播放 这是什么原因呢
ive-player和live-pusher这两个都是原生组件,暂时没有办法调整
从微信客户端6.7.2版本开始,若需要在小程序切后台后继续播放音频,需要在 app.json 中配置 requiredBackgroundModes 属性。开发版和体验版上可以直接生效,正式版还需通过审核。https://developers.weixin.qq.com/miniprogram/dev/api/wx.getBackgroundAudioManager.html
requiredBackgroundModes
关注后,可在微信内接收相应的重要提醒。
请使用微信扫描二维码关注 “微信开放社区” 公众号
live-player和live-pusher:
1: live-player 绝对定位absolute占满屏幕
2:都用wx:if 控制显示就ok
<
view
wx:if
=
"{{!isCalling}}"
class
=
'fullscreen'
>
<
view
class
=
'video-wrapper'
>
<
live-player
id
=
"yunxin-player"
wx:if
=
"{{playerUrl}}"
src
=
"{{playerUrl}}"
mode
=
"RTC"
autoplay
min-cache
=
"{{0.1}}"
max-cache
=
"{{0.3}}"
@
statechange
=
"statechangeplayer"
@
error
=
"errorplayer"
style
=
"position: absolute; width: 100%; height: 100vh; top: 0; left: 0;background-color: transparent;"
>
<
cover-view
class
=
'control-wrapper'
>
<
cover-view
class
=
'netcall-time-text'
>{{duration}}</
cover-view
>
<
cover-image
class
=
"item"
src
=
"/assets/img/yunxin/netcall-revert-camera.png"
@
tap.stop
=
"switchCameraHandler"
>切摄像头</
cover-image
>
<
cover-image
class
=
"item"
src
=
"/assets/img/yunxin/netcall-camera{{enableCamera ? '' : '-close'}}.png"
data-mode
=
"1"
@
tap.stop
=
"switchMeetingModeHandler"
>关闭摄像头</
cover-image
>
<
cover-image
class
=
"item"
src
=
"/assets/img/yunxin/netcall-micro{{muted ? '-close' : ''}}.png"
data-mode
=
"2"
@
tap.stop
=
"switchMeetingModeHandler"
>关闭麦克风</
cover-image
>
<
cover-image
class
=
"item"
src
=
"/assets/img/yunxin/netcall-reject.png"
@
tap.stop
=
"hangupHandler"
>挂断</
cover-image
>
</
cover-view
>
</
live-player
>
<
live-pusher
id
=
"yunxin-pusher"
wx:if
=
"{{playerUrl}}"
url
=
"{{userlist[0].url}}"
mode
=
"RTC"
autopush @
statechange
=
"statechangepusher"
@
netstatus
=
"netstatus"
enable-camera
=
"{{enableCamera}}"
muted
=
"{{muted}}"
style
=
"width: 100px; height: 150px;right: -260px;top: 30px;"
/>
</
view
>
</
view
>
附上代码片段(网易云音视频通讯demo)
3.推流地址一开始就获取到了,但是拉流地址要等人接进来才有。故当playerUrl存在的时候显示live-player和live-pusher即可实现
你好,请具体描述问题。
现在想要实现一个双向视频的功能,其中主画面是 live-player主键,占整个手机屏幕.live-pusher是次画面,放在屏幕的右下角,并且显示层级比live-player高,覆盖在live-player上面.经过测试,发现这个2个原生组件的层级永远是live-player比较高,live-pusher会被完全遮挡住.
想请教下有没有方法调整这2个组件之间的显示层级?
大神你好
wx.getBackgroundAudioManager()
现在线上 锁屏时能播放 线下 开发版和体验版都不能播放 这是什么原因呢
ive-player和live-pusher这两个都是原生组件,暂时没有办法调整
从微信客户端6.7.2版本开始,若需要在小程序切后台后继续播放音频,需要在 app.json 中配置
requiredBackgroundModes
属性。开发版和体验版上可以直接生效,正式版还需通过审核。https://developers.weixin.qq.com/miniprogram/dev/api/wx.getBackgroundAudioManager.html