liuyu 4 rokov pred
rodič
commit
159b880a41
1 zmenil súbory, kde vykonal 6 pridanie a 13 odobranie
  1. 6 13
      src/views/live/roomDetail.vue

+ 6 - 13
src/views/live/roomDetail.vue

@@ -390,17 +390,8 @@ export default {
           this.stermPlay(oldstrem_.strem, 'look-video-right');
           if (body.userid === this.user.uid) {
             this.stermStop(this.localStream_);
-            const videoTrack = this.localStream_.getVideoTrack();
-            if (videoTrack) {
-              this.localStream_.removeTrack(videoTrack).then(() => {
-                console.log('remove video call success');
-                // 关闭摄像头
-                videoTrack.stop();
-                // this.client_.unpublish(this.localStream_).then(() => {
-                //   // 取消发布本地流成功
-                // });
-              });
-            }
+            this.localStream_.muteAudio();
+            this.localStream_.muteVideo();
           }
         }
       }
@@ -700,6 +691,7 @@ export default {
               const newdata = { swichuserid: userid_zs, swichindex: this.index_ };
               this.swichusers.push(newdata);
               console.log('将用户push到列表里' + newdata);
+              this.stermStop(remoteStream);
               remoteStream.play(id_);
             }
           } else if (useridsplit_ === 'wxxcx') {
@@ -740,7 +732,8 @@ export default {
         this.client_.on('mute-video', event => {
           const remoteStream = event.stream;
           console.log('退出');
-          console.log('退出remoteStream' + remoteStream);
+          console.log(event);
+          console.log('退出remoteStream' + event);
           if (remoteStream) {
             const userid_ = remoteStream.getUserId();
             const useridsplit_ = userid_.substring(0, 5);
@@ -754,7 +747,7 @@ export default {
               }
             }
           }
-          console.log('333--index---->' + this.index);
+          console.log('333--index---->' + this.index_);
         });
       }
     },