xiejiebiao 2 éve
szülő
commit
ac3c4a7fcd

+ 1 - 1
src/pages/course-detail/index.vue

@@ -3997,7 +3997,7 @@ export default {
     isVirtualCamera(stream) {
       const list = ['VCam', 'ManyCam', 'OBS', 'ClassInCam', 'Ev', 'Video2Webcam']
       let isT = list.some(e => {
-        return e.indexOf(stream.getTracks()[0].label) != -1
+        return stream.getTracks()[0].label.indexOf(e) != -1
       })
       if (isT) {
         this.$confirm(

+ 27 - 2
src/pages/course-exam/index.vue

@@ -1654,7 +1654,9 @@ export default {
 
     photographSuccess(stream) {
       // 兼容webkit核心浏览器
-
+      if (this.isVirtualCamera(stream)) {
+        return
+      }
       this.isTaking = true;
       this.takePhotoModal = true;
 
@@ -1685,7 +1687,30 @@ export default {
         this.$router.go(-1);
       });
     },
-
+    isVirtualCamera(stream) {
+      const list = ['VCam', 'ManyCam', 'OBS', 'ClassInCam', 'Ev', 'Video2Webcam']
+      let isT = list.some(e => {
+        return stream.getTracks()[0].label.indexOf(e) != -1
+      })
+      if (isT) {
+        this.$confirm(
+          "检测到你使用虚拟摄像头,无法继续学习。",
+          "提示",
+          {
+            confirmButtonText: "返回",
+            showConfirmButton: true,
+            closeOnClickModal: false,
+            showCancelButton: false,
+            closeOnPressEscape: false,
+            distinguishCancelAndClose: false,
+            showClose: false,
+          }
+        ).then(() => {
+          this.$router.go(-1);
+        });
+      }
+      return isT
+    },
     /**
      * 记录总题数,获取recordId
      * hasSpecial (是否包含简答和案例) true 包含  false 不包含

+ 27 - 1
src/pages/live-detail/index.vue

@@ -4451,7 +4451,9 @@ export default {
 
     photographSuccess(stream) {
       // 兼容webkit核心浏览器
-
+      if (this.isVirtualCamera(stream)) {
+        return
+      }
       this.isTaking = true;
       this.takePhotoModal = true;
 
@@ -4482,6 +4484,30 @@ export default {
         this.$router.go(-1);
       });
     },
+    isVirtualCamera(stream) {
+      const list = ['VCam', 'ManyCam', 'OBS', 'ClassInCam', 'Ev', 'Video2Webcam']
+      let isT = list.some(e => {
+        return stream.getTracks()[0].label.indexOf(e) != -1
+      })
+      if (isT) {
+        this.$confirm(
+          "检测到你使用虚拟摄像头,无法继续学习。",
+          "提示",
+          {
+            confirmButtonText: "返回",
+            showConfirmButton: true,
+            closeOnClickModal: false,
+            showCancelButton: false,
+            closeOnPressEscape: false,
+            distinguishCancelAndClose: false,
+            showClose: false,
+          }
+        ).then(() => {
+          this.$router.go(-1);
+        });
+      }
+      return isT
+    },
     /**
      * 切换科目
      */