liuyu 4 年之前
父節點
當前提交
ad28821332
共有 1 個文件被更改,包括 13 次插入0 次删除
  1. 13 0
      src/views/live/roomMeet.vue

+ 13 - 0
src/views/live/roomMeet.vue

@@ -170,6 +170,19 @@ export default {
           this.switchbtn = true;
         } else {
           this.switchbtn = false;
+          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.iscamera = false;
+          this.typevalue = 'warning';
         }
       }
     },