Przeglądaj źródła

聊天时开放视频监控

zhangjie 3 lat temu
rodzic
commit
1141bef1c3

+ 16 - 6
src/features/invigilation/RealtimeMonitoring/WarningDetail.vue

@@ -711,7 +711,7 @@ export default {
       // 手机端userId各不同
       if (this.holding) return;
       this.holding = true;
-      this.closeSubscribeVideo();
+      this.videoAllMute();
 
       await this.initClient(this.recordId).catch(() => {});
       if (!this.client) {
@@ -840,13 +840,13 @@ export default {
 
       this.dialogVisible = false;
       this.isWaiting = true;
-      this.initSubscribeVideo();
+      // this.initSubscribeVideo();
     },
     videoMute(type) {
       if (type === "first") {
         if (this.secondViewVideoReady) {
-          this.secondViewVideo.muted = true;
-          this.$refs.SecondViewVideo.mutedPlayer(true);
+          let res = this.$refs.SecondViewVideo.mutedPlayer(true);
+          if (res) this.secondViewVideo.muted = true;
         }
 
         const res = this.$refs.FirstViewVideo.mutedPlayer(
@@ -855,8 +855,8 @@ export default {
         if (res) this.firstViewVideo.muted = !this.firstViewVideo.muted;
       } else {
         if (this.firstViewVideoReady) {
-          this.firstViewVideo.muted = true;
-          this.$refs.FirstViewVideo.mutedPlayer(true);
+          let res = this.$refs.FirstViewVideo.mutedPlayer(true);
+          if (res) this.firstViewVideo.muted = true;
         }
 
         const res = this.$refs.SecondViewVideo.mutedPlayer(
@@ -866,6 +866,16 @@ export default {
         if (res) this.secondViewVideo.muted = !this.secondViewVideo.muted;
       }
     },
+    videoAllMute() {
+      if (this.firstViewVideoReady) {
+        let res = this.$refs.FirstViewVideo.mutedPlayer(true);
+        if (res) this.firstViewVideo.muted = true;
+      }
+      if (this.secondViewVideoReady) {
+        let res = this.$refs.SecondViewVideo.mutedPlayer(true);
+        if (res) this.secondViewVideo.muted = true;
+      }
+    },
     toViewImg(photo) {
       this.curImage = { imgSrc: photo };
       this.$refs.SimpleImagePreview.open();