|
@@ -384,7 +384,11 @@ export default {
|
|
|
this.switchbtn = false;
|
|
|
this.switchmeetbtn = false;
|
|
|
}
|
|
|
- if (body.switchrole !== 'anchor' && body.userid === this.user.uid) {
|
|
|
+ if (body.switchrole === 'audience' && body.userid === this.user.uid) {
|
|
|
+ this.stermStop(this.localStream_);
|
|
|
+ const oldstrem_ = _.find(this.stremlist, { type: 'mainr' });
|
|
|
+ this.stermStop(oldstrem_.strem);
|
|
|
+ this.stermPlay(oldstrem_.strem, 'look-video-right');
|
|
|
const videoTrack = this.localStream_.getVideoTrack();
|
|
|
if (videoTrack) {
|
|
|
this.localStream_.removeTrack(videoTrack).then(() => {
|
|
@@ -395,10 +399,6 @@ export default {
|
|
|
// // 取消发布本地流成功
|
|
|
// });
|
|
|
});
|
|
|
- const oldstrem_ = _.find(this.stremlist, { type: 'mainr' });
|
|
|
- this.stermStop(this.localStream_);
|
|
|
- this.stermStop(oldstrem_.strem);
|
|
|
- this.stermPlay(oldstrem_.strem, 'look-video-right');
|
|
|
}
|
|
|
}
|
|
|
}
|