scandoc-ai-components 0.0.81 → 0.0.82
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 +10 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -11190,6 +11190,7 @@ class ExtractorVideo {
|
|
|
11190
11190
|
this.scanStartTime = null;
|
|
11191
11191
|
this.unsupportedDocCount = 0;
|
|
11192
11192
|
this.video = null;
|
|
11193
|
+
this.lastMessage = null;
|
|
11193
11194
|
}
|
|
11194
11195
|
reset() {
|
|
11195
11196
|
this.stopVideo();
|
|
@@ -11202,6 +11203,7 @@ class ExtractorVideo {
|
|
|
11202
11203
|
this.unsupportedDocStartTime = null;
|
|
11203
11204
|
this.unsupportedDocCount = 0;
|
|
11204
11205
|
this.video = null;
|
|
11206
|
+
this.lastMessage = null;
|
|
11205
11207
|
}
|
|
11206
11208
|
async analyzeVideoStream() {
|
|
11207
11209
|
if (!this.isRunning) {
|
|
@@ -11269,9 +11271,11 @@ class ExtractorVideo {
|
|
|
11269
11271
|
const imageId = response["Index"];
|
|
11270
11272
|
const imageSide = response["Side"];
|
|
11271
11273
|
//
|
|
11272
|
-
if (this.extractionImages[imageSide]
|
|
11273
|
-
this.
|
|
11274
|
+
if (this.extractionImages[imageSide] !== undefined) {
|
|
11275
|
+
this.candidateImages = [];
|
|
11276
|
+
return;
|
|
11274
11277
|
}
|
|
11278
|
+
this.extractionImages[imageSide] = images[imageId]["fullImg"];
|
|
11275
11279
|
const extractionImages = {
|
|
11276
11280
|
...this.extractionImages
|
|
11277
11281
|
};
|
|
@@ -11310,6 +11314,7 @@ class ExtractorVideo {
|
|
|
11310
11314
|
onExtraction(isExtractionOk, extractionData) {
|
|
11311
11315
|
this.candidateImages = [];
|
|
11312
11316
|
this.extractionImages = {};
|
|
11317
|
+
this.lastMessage = null;
|
|
11313
11318
|
this.stopVideo();
|
|
11314
11319
|
if (isExtractionOk) {
|
|
11315
11320
|
this.showMessage("Success - data extracted", "success");
|
|
@@ -11386,6 +11391,7 @@ class ExtractorVideo {
|
|
|
11386
11391
|
}
|
|
11387
11392
|
stopVideo() {
|
|
11388
11393
|
this.isRunning = false;
|
|
11394
|
+
this.lastMessage = null;
|
|
11389
11395
|
if (this.video) {
|
|
11390
11396
|
this.video.pause();
|
|
11391
11397
|
if (this.video.srcObject !== undefined && this.video.srcObject !== null) {
|
|
@@ -11395,6 +11401,8 @@ class ExtractorVideo {
|
|
|
11395
11401
|
}
|
|
11396
11402
|
}
|
|
11397
11403
|
showMessage(message) {
|
|
11404
|
+
if (this.lastMessage === message) return;
|
|
11405
|
+
this.lastMessage = message;
|
|
11398
11406
|
const messageElement = document.getElementById("ScanDocAIMessage");
|
|
11399
11407
|
if (messageElement) {
|
|
11400
11408
|
messageElement.innerText = message;
|