scandoc-ai-components 0.0.62 → 0.0.63
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +14 -10
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -11405,17 +11405,21 @@ class ExtractorVideo {
|
|
|
11405
11405
|
await this.video.play().catch(e => {
|
|
11406
11406
|
console.warn(`Error on video play: ${e}`);
|
|
11407
11407
|
});
|
|
11408
|
-
|
|
11409
|
-
|
|
11410
|
-
|
|
11411
|
-
|
|
11412
|
-
|
|
11413
|
-
|
|
11414
|
-
|
|
11415
|
-
|
|
11408
|
+
window.addEventListener("resize", () => {
|
|
11409
|
+
if (this.isRunning) {
|
|
11410
|
+
setTimeout(() => this.getCameraMargins().then(margins => {
|
|
11411
|
+
const rectangle = document.querySelector('.desktopRectangle');
|
|
11412
|
+
const clamp = (v, max = 0.25) => Math.min(v, max) * 100;
|
|
11413
|
+
const buffer = 0.03;
|
|
11414
|
+
if (rectangle) {
|
|
11415
|
+
rectangle.style.top = `${clamp(margins.topPct + buffer)}%`;
|
|
11416
|
+
rectangle.style.bottom = `${clamp(margins.bottomPct + buffer)}%`;
|
|
11417
|
+
rectangle.style.left = `${clamp(margins.leftPct + buffer)}%`;
|
|
11418
|
+
rectangle.style.right = `${clamp(margins.rightPct + buffer)}%`;
|
|
11419
|
+
}
|
|
11420
|
+
}), 500);
|
|
11416
11421
|
}
|
|
11417
|
-
}
|
|
11418
|
-
|
|
11422
|
+
});
|
|
11419
11423
|
this.scanStartTime = Date.now(); // Reset timer
|
|
11420
11424
|
setTimeout(() => this.analyzeVideoStream(), ExtractorVideo.FREQUENCY_MS);
|
|
11421
11425
|
this.showMessage("Starting scanning");
|