提交 a16011ff 编写于 作者: huangwensu's avatar huangwensu

Merge branch 'dev-diagnosis-20210323' of...

Merge branch 'dev-diagnosis-20210323' of http://192.168.110.53/com.pica.cloud.education.frontend/pica-admin-consultation into dev-diagnosis-20210323
...@@ -279,16 +279,16 @@ class RtcClient { ...@@ -279,16 +279,16 @@ class RtcClient {
console.log(`${event.type} player is ${event.state}`); console.log(`${event.type} player is ${event.state}`);
// 远端流是播放还是暂停状态(显示按钮等画面不同) // 远端流是播放还是暂停状态(显示按钮等画面不同)
if (event.type == 'video' && event.state == 'STOPPED') { if (event.type == 'video' && event.state == 'STOPPED') {
console.log('远端流为停止'); console.log(`${uid}----------远端流为停止`);
this.changeView(id, 'mask', true) this.changeView(uid, 'mask', true)
} }
if (event.type == 'video' && event.state == 'PAUSED') { if (event.type == 'video' && event.state == 'PAUSED') {
console.log('远端流为暂停'); console.log(`${uid}----------远端流为暂停`);
this.changeView(id, 'mask', true) this.changeView(uid, 'mask', true)
} }
if (event.type == 'video' && event.state == 'PLAYING') { if (event.type == 'video' && event.state == 'PLAYING') {
console.log('远端流为播放'); console.log(`${uid}----------远端流为播放`);
this.changeView(id, 'mask', false) this.changeView(uid, 'mask', false)
} }
}); });
...@@ -336,7 +336,7 @@ class RtcClient { ...@@ -336,7 +336,7 @@ class RtcClient {
const remoteStream = evt.stream; const remoteStream = evt.stream;
const id = remoteStream.getId(); const id = remoteStream.getId();
const uid = remoteStream.userId_; const uid = remoteStream.userId_;
console.log('远程流被移除时触发'); console.log(`${uid}------------远程流被移除时触发`);
// 停止播放并删除相应<video>标签 // 停止播放并删除相应<video>标签
remoteStream.stop(); remoteStream.stop();
this.inmembers_.delete(uid) this.inmembers_.delete(uid)
...@@ -402,7 +402,7 @@ class RtcClient { ...@@ -402,7 +402,7 @@ class RtcClient {
remove(userId) { remove(userId) {
for(let i = 0; i < this.viewslist.length; i++) { for(let i = 0; i < this.viewslist.length; i++) {
if (this.viewslist[i] && this.viewslist[i].userId == userId) { if (this.viewslist[i] && this.viewslist[i].userId == userId) {
this.viewslist.splice(i, 1) this.viewslist[i] = null
} }
} }
this.vueInstance.removeMember(userId) this.vueInstance.removeMember(userId)
...@@ -418,7 +418,7 @@ class RtcClient { ...@@ -418,7 +418,7 @@ class RtcClient {
add(id, uid, isMask) { add(id, uid, isMask) {
this.vueInstance.memberList.forEach((ele,index) => { this.vueInstance.memberList.forEach((ele,index) => {
if (ele.accId == uid) { if (ele.liveUserId == uid) {
this.viewslist[index] = { id: id, userId: uid, nick: uid, mask: isMask, vioce: true } this.viewslist[index] = { id: id, userId: uid, nick: uid, mask: isMask, vioce: true }
} }
}); });
......
...@@ -143,7 +143,7 @@ export default { ...@@ -143,7 +143,7 @@ export default {
this.memberList[1] = Object.assign(item,{status: 1}) this.memberList[1] = Object.assign(item,{status: 1})
} }
if (item.role == 4) { if (item.role == 4) {
this.userId = item.accId this.userId = item.liveUserId
} }
}) })
} }
...@@ -297,7 +297,7 @@ export default { ...@@ -297,7 +297,7 @@ export default {
// 用户上线 // 用户上线
addNewMember(id) { addNewMember(id) {
this.memberList.forEach(item => { this.memberList.forEach(item => {
if (item.accId == id) { if (item.liveUserId == id) {
item.status = 2 item.status = 2
this.setTime(item.role) this.setTime(item.role)
} }
...@@ -306,7 +306,7 @@ export default { ...@@ -306,7 +306,7 @@ export default {
// 用户下线 // 用户下线
removeMember(id) { removeMember(id) {
this.memberList.forEach(item => { this.memberList.forEach(item => {
if (item.accId == id) { if (item.liveUserId == id) {
item.status = 3 item.status = 3
} }
}) })
...@@ -374,6 +374,7 @@ export default { ...@@ -374,6 +374,7 @@ export default {
// client离开房间 // client离开房间
leave() { leave() {
this.rtc.leave() this.rtc.leave()
this.clearSession()
this.$router.go(-1) this.$router.go(-1)
}, },
// 结束会话 // 结束会话
...@@ -440,16 +441,17 @@ export default { ...@@ -440,16 +441,17 @@ export default {
clearInterval(this.answerTimeFn) clearInterval(this.answerTimeFn)
clearInterval(this.useTimeFn) clearInterval(this.useTimeFn)
clearInterval(this.loseTimeFn) clearInterval(this.loseTimeFn)
},
// 清除直播时间相关的seession
clearSession() {
sessionStorage.removeItem('TIME_askTime')
sessionStorage.removeItem('TIME_answerTime')
sessionStorage.removeItem('TIME_useTime')
sessionStorage.removeItem('TIME_loseTime')
} }
}, },
beforeDestroy() { beforeDestroy() {
console.log('===========this.askTimeFn========================='); this.clearTime()
console.log(this.askTimeFn);
console.log('====================================');
clearInterval(this.askTimeFn)
clearInterval(this.answerTimeFn)
clearInterval(this.useTimeFn)
clearInterval(this.loseTimeFn)
} }
} }
</script> </script>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册