收藏
回答

voip-room组件先进入的人退出就会卡住其他人的画面,重进也不行?

<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);
					}
				})
			},
			// 成员变化时修改openid列表;
			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);
						}
					})
				})
			}


回答关注问题邀请回答
收藏

1 个回答

  • 热河
    热河
    2022-04-25

    超过两个人,出现黑屏的问题,两个人的时候先进的人退出第二个人就会卡住。重进也没用。但是后进的人进出不会影响第一个人的画面

    2022-04-25
    有用
    回复
登录 后发表内容