voip-room 组件渲染不出来?
问题描述: 第二个手机进入后可以看到自己和第一个手机的画面, 第一个手机只能看到自己和黑屏, 大概10次有7,8次会这样 创建room的手机: [图片] 加入room的手机: [图片] [图片] 第一台手机通过 `onVoIPChatMembersChanged` 拿到了第二台的openid, 渲染也渲染了, 但渲染得到黑屏 --- 我尝试用三个手机(结果也很迷惑) 1能看到1,22能看到2,33能看到1,3--- wxml <view class="room-list" >
<voip-room wx:for="{{openid_list}}" wx:key="index"
openid="{{item}}" binderror="voipErr" class="room" mode="{{item == my_openid ? 'camera': 'video'}}"></voip-room>
</view>
js data: {
openid_list: [],
my_openid: ""
},
join(){
console.log('taped join');
console.log('now ip is: ', this.data.root);
wx.login({
success: (login_res) => {
console.log('login ok:', login_res);
wx.request({
url: `http://${this.data.root}:3000/voip/getVeryfiCation`,
method: 'post',
data: {
code: login_res.code
},
success: (res) => {
console.log('res', res);
this.setData({
my_openid: res.data.openid
})
wx.joinVoIPChat({
roomType: "video",
signature: res.data.signature,
nonceStr: res.data.nonceStr,
timeStamp: res.data.timeStamp,
groupId: res.data.groupId,
success: (res) => {
console.log('openIdList', res.openIdList);
console.log("my open id", this.data.my_openid);
// 当成员>2时订阅成员
wx.subscribeVoIPVideoMembers({
openIdList: res.openIdList
})
this.setData({
openid_list: res.openIdList
})
// 处理成员进出
wx.onVoIPChatMembersChanged( (member_res) => {
// 当成员>2时订阅成员
wx.subscribeVoIPVideoMembers({
openIdList: res.openIdList
})
this.setData({
openid_list: member_res.openIdList
})
});
},
fail: (err) => {
console.log('err', err);
}
})
},
fail: (err) => {
console.log('fail to auth', err);
}
})
// console.log('veryfication_res', veryfication_res);
}
})
}