jack 3 年之前
父节点
当前提交
6283fa06a6
共有 1 个文件被更改,包括 8 次插入3 次删除
  1. 8 3
      src/components/functionFan2.vue

+ 8 - 3
src/components/functionFan2.vue

@@ -285,9 +285,14 @@ export default {
       this.updateMessage = false;
     },
     async handsFind(video) {
-      let hands = await this.detector.estimateHands(video, {
-        flipHorizontal: false,
-      });
+      let hands = [];
+      try {
+        hands = await this.detector.estimateHands(video, {
+          flipHorizontal: false,
+        });
+      } catch (e) {
+        return;
+      }
       console.log(hands);
       if (hands.length > 0 && this.isCamera) {
         let handsA = hands[0].keypoints;