浏览代码

定时器清理

Michael Wang 5 年之前
父节点
当前提交
9e97d9540c
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      src/features/OnlineExam/Examing/FaceMotion/FaceMotion.vue

+ 3 - 0
src/features/OnlineExam/Examing/FaceMotion/FaceMotion.vue

@@ -867,6 +867,9 @@ export default {
             resolve();
             clearInterval(interval);
           }
+          if (document.getElementById("inputVideo") === null) {
+            clearInterval(interval);
+          }
         }, 300);
       });
       console.log(videoEl.readyState, faceapi.nets.tinyFaceDetector.params);