<block v-for="item in openIdList" :key='item'>
<voip-room class="room_item" :openid="item" :device-position="device_position"
:mode="selfOpenId == item ? 'camera' : 'video'">
</voip-room>
</block>
jscode:
joinRoom() {
uni.showLoading({
title: '正在加载视频会议'
})
let that = this
uni.login({
success(rData) {
console.log(rData)
that.$http({
url: 'wxpay/createSign',
data: {
code: rData.code
},
}).then(res => {
wx.joinVoIPChat({
muteConfig: {
muteMicrophone: that.muteMicrophone
},
roomType: 'video',
signature: res.data.signature,
nonceStr: res.data.nonceStr,
timeStamp: res.data.timeStamp,
groupId: res.data.groupId,
success: function(roomData) {
that.openIdList = roomData.openIdList
that.subscribeVoIPVideoMembers()
that.onVoIPChatMembersChanged()
that.onVoIPVideoMembersChanged()
uni.hideLoading()
console.log(roomData)
},
fail: function(roomData) {
console.log(roomData)
}
})
})
},
})
},
subscribeVoIPVideoMembers() {
let that = this
wx.subscribeVoIPVideoMembers({
openIdList: that.openIdList,
success(res) {
console.log('subscribeVoIPVideoMembers ok', res);
},
fail(err) {
console.log('subscribeVoIPVideoMembers fail', err);
}
})
},
onVoIPChatMembersChanged() {
let that = this
wx.onVoIPChatMembersChanged((result) => {
console.log('member change', result);
that.openIdList = result.openIdList;
that.subscribeVoIPVideoMembers()
that.onVoIPVideoMembersChanged()
})
},
onVoIPVideoMembersChanged() {
wx.onVoIPVideoMembersChanged((result) => {
wx.subscribeVoIPVideoMembers({
openIdList: result.openIdList,
success(res) {
console.log('onVoIPVideoMembersChanged ok', res);
},
fail(err) {
console.log('onVoIPVideoMembersChanged fail', err);
}
})
})
}
超过两个人,出现黑屏的问题,两个人的时候先进的人退出第二个人就会卡住。重进也没用。但是后进的人进出不会影响第一个人的画面