Browse Source

定时器清理

Michael Wang 5 years ago
parent
commit
9e97d9540c
1 changed files with 3 additions and 0 deletions
  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);