|
@@ -214,6 +214,7 @@ export default {
|
|
|
detector: null,
|
|
|
hand: 0,
|
|
|
isC: false,
|
|
|
+ f:null,
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
@@ -226,7 +227,7 @@ export default {
|
|
|
this.fnsample();
|
|
|
}
|
|
|
},
|
|
|
- start() {
|
|
|
+ async start() {
|
|
|
this.isZuan = true;
|
|
|
this.isCamera = true;
|
|
|
let video = this.$refs["video"];
|
|
@@ -234,8 +235,8 @@ export default {
|
|
|
if (this.detector == null) {
|
|
|
await this.fnInit();
|
|
|
}
|
|
|
- var f = window.requestAnimationFrame(function () {
|
|
|
- window.cancelAnimationFrame(f);
|
|
|
+ that.f = window.requestAnimationFrame(function () {
|
|
|
+ window.cancelAnimationFrame(that.f);
|
|
|
setTimeout(function () {
|
|
|
that.handsFind(video);
|
|
|
that.start();
|
|
@@ -400,9 +401,10 @@ export default {
|
|
|
// });
|
|
|
// this.$refs["video"].srcObject = null;
|
|
|
this.isCamera = false;
|
|
|
-
|
|
|
+ window.cancelAnimationFrame(this.f);
|
|
|
this.isZuan = false;
|
|
|
clearInterval(this.timer);
|
|
|
+ this.$refs.fan.className = "asn";
|
|
|
this.timer = null;
|
|
|
this.hand = 0;
|
|
|
},
|
|
@@ -696,7 +698,7 @@ export default {
|
|
|
},
|
|
|
mounted() {
|
|
|
this.blocklyInit();
|
|
|
- await this.fnInit();
|
|
|
+ this.fnInit();
|
|
|
this.callCamera();
|
|
|
this.videoEl = this.$refs.video;
|
|
|
this.canvasEL = this.$refs.canvasDOM;
|