// 监测远端用户加入(创建容器)
uni.$on("peeridJoinChannel", data => {
if (data) {
const oa = this.peeridInfo.filter((item) => {
return item.uid == data
})
if (oa.length == 0) {
this.peeridInfo.push({
uid: data,
videoStatus: true,
});
this.$nextTick(() => {
uni.$emit("CanvasView", {
remote: this.$refs['remote' + data],
peerid: data,
})
console.log('是否获取组件', this.$refs['remote' + data])
this.$refs['remote' + data].setupRemoteVideo({
// "uid":"",
// "channelId":"",
"renderMode":1,
// "mirrorMode":0
},(res) => {
//something
console.log('res, 铺满', res)
})
})
}
}
});
结果:
11:34:07.454 是否获取组件, [Object] [{"ref":"1795","type":"AR-CanvasView","attr":{"@styleScope":"data-v-19a14084"},"style":{"flex":"1"}}] at pages/index/rtcPage.nvue:135
11:34:07.475 TypeError: _this.$refs[("remote" + data)].setupRemoteVideo is not a function