|
@@ -21,7 +21,7 @@
|
|
|
</el-col>
|
|
|
<el-col :span="20" class="right">
|
|
|
<el-col :span="24" class="rightTop">
|
|
|
- <span @click="liveon"><i class="iconfont iconshexiangtou"></i>摄像头</span>
|
|
|
+ <span @click="liveon"><i class="iconfont iconshexiangtou"></i>直播</span>
|
|
|
<span @click="liveclose">关闭</span>
|
|
|
</el-col>
|
|
|
<el-col :span="18" class="video">
|
|
@@ -118,6 +118,7 @@ export default {
|
|
|
userId_: '',
|
|
|
open_: false,
|
|
|
dataList: [],
|
|
|
+ index: 0,
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
@@ -210,14 +211,13 @@ export default {
|
|
|
this.localStream_.play('main-video');
|
|
|
//$('#mask_main').appendTo($('#player_' + this.localStream_.getId()));
|
|
|
// 订阅其他用户音视频
|
|
|
- let i = 0;
|
|
|
this.client_.on('stream-subscribed', event => {
|
|
|
const remoteStream = event.stream;
|
|
|
// 远端流订阅成功,播放远端音视频流
|
|
|
console.log('111' + remoteStream.getType());
|
|
|
- i = i + 1;
|
|
|
- if (i < 8) {
|
|
|
- const id_ = 'look-video-' + i;
|
|
|
+ this.index = this.index + 1;
|
|
|
+ if (this.index < 8) {
|
|
|
+ const id_ = 'look-video-' + this.index;
|
|
|
remoteStream.play(id_);
|
|
|
}
|
|
|
});
|
|
@@ -230,6 +230,12 @@ export default {
|
|
|
console.error('failed to subscribe remoteStream');
|
|
|
});
|
|
|
});
|
|
|
+ this.client_.on('unmute-video', event => {
|
|
|
+ const remoteStream = event.stream;
|
|
|
+ // 订阅远端音频和视频流
|
|
|
+ this.index = this.index - 1;
|
|
|
+ console.log('index---->' + this.index);
|
|
|
+ });
|
|
|
},
|
|
|
async liveclose() {
|
|
|
// 关闭视频通话
|