Explorar o código

摄像头必须

y595705120 %!s(int64=2) %!d(string=hai) anos
pai
achega
41debdfc14
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  1. 4 1
      src/containers/center/play/components/iMedia.vue

+ 4 - 1
src/containers/center/play/components/iMedia.vue

@@ -151,6 +151,7 @@
             this.$message.error(
             this.$message.error(
               "摄像头开启失败,请检查摄像头是否可用!或者打开摄影头"
               "摄像头开启失败,请检查摄像头是否可用!或者打开摄影头"
             );
             );
+            this.isnotbtn=false
             console.error("摄像头开启失败,请检查摄像头是否可用!");
             console.error("摄像头开启失败,请检查摄像头是否可用!");
           });
           });
       },
       },
@@ -282,8 +283,10 @@
           console.log("finish")
           console.log("finish")
           return;
           return;
         }
         }
-        if( !this.isnotbtn ){
+
+        if( !this.isnotbtn && this.onPlay ){
           this.$message.errorMsg("需要安装摄像头才能学习", 2);
           this.$message.errorMsg("需要安装摄像头才能学习", 2);
+          this.doPause()
           return;
           return;
         }
         }
         if( this.errCount > 3 ){
         if( this.errCount > 3 ){