From cfbee47697459d5e1d6a85867878be1b4cf6e8e7 Mon Sep 17 00:00:00 2001 From: usbsync Date: Wed, 1 Feb 2023 13:00:09 +0900 Subject: [PATCH] =?UTF-8?q?=EB=B9=84=EB=94=94=EC=98=A4=20=EC=8B=9C?= =?UTF-8?q?=EC=9E=91=EC=8B=9C=20=EC=A2=8C=EC=9A=B0=20=EB=B0=98=EC=A0=84=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/util/videoUtils.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/util/videoUtils.ts b/src/util/videoUtils.ts index c45735e090..4eb807359c 100644 --- a/src/util/videoUtils.ts +++ b/src/util/videoUtils.ts @@ -16,6 +16,7 @@ import clamp from 'lodash/clamp'; type FlipStatus = { horizontal: boolean; vertical: boolean; + isChanged: boolean; }; type ModelStatus = { @@ -79,6 +80,7 @@ class VideoUtils implements MediaUtilsInterface { public flipStatus: FlipStatus = { horizontal: false, vertical: false, + isChanged: false, }; public indicatorStatus: ModelStatus = { @@ -414,7 +416,7 @@ class VideoUtils implements MediaUtilsInterface { } videoOnLoadHandler() { - if (!this.flipStatus.horizontal) { + if (!this.flipStatus.horizontal && !this.flipStatus.isChanged) { this.setOptions('hflip', null); } } @@ -745,6 +747,7 @@ class VideoUtils implements MediaUtilsInterface { GEHelper.setVideoAlpha(this.canvasVideo, value); break; case 'hflip': + this.flipStatus.isChanged = true; this.flipStatus.horizontal = !this.flipStatus.horizontal; if (this.isChrome) { this.worker.postMessage({ @@ -755,6 +758,7 @@ class VideoUtils implements MediaUtilsInterface { GEHelper.hFlipVideoElement(this.canvasVideo); break; case 'vflip': + this.flipStatus.isChanged = true; this.flipStatus.vertical = !this.flipStatus.vertical; GEHelper.vFlipVideoElement(this.canvasVideo); break; @@ -821,6 +825,7 @@ class VideoUtils implements MediaUtilsInterface { this.disableAllModels(); GEHelper.resetHandlers(); this.turnOffWebcam(); + this.flipStatus.isChanged = false; if (!this.flipStatus.horizontal) { this.setOptions('hflip', null); } @@ -864,6 +869,7 @@ class VideoUtils implements MediaUtilsInterface { this.flipStatus = { horizontal: false, vertical: false, + isChanged: false, }; this.objects = []; this.poses = { predictions: [], adjacents: [] };