@jaak.ai/stamps 2.1.0-beta.1 → 2.1.0-beta.2
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/cjs/jaak-stamps.cjs.entry.js +109 -18
- package/dist/cjs/jaak-stamps.cjs.entry.js.map +1 -1
- package/dist/cjs/jaak-stamps.entry.cjs.js.map +1 -1
- package/dist/collection/components/my-component/my-component.js +25 -16
- package/dist/collection/components/my-component/my-component.js.map +1 -1
- package/dist/collection/services/CameraService.js +84 -2
- package/dist/collection/services/CameraService.js.map +1 -1
- package/dist/components/jaak-stamps.js +109 -18
- package/dist/components/jaak-stamps.js.map +1 -1
- package/dist/esm/jaak-stamps.entry.js +109 -18
- package/dist/esm/jaak-stamps.entry.js.map +1 -1
- package/dist/jaak-stamps-webcomponent/jaak-stamps-webcomponent.esm.js +1 -1
- package/dist/jaak-stamps-webcomponent/jaak-stamps.entry.esm.js.map +1 -1
- package/dist/jaak-stamps-webcomponent/p-c06e5d7b.entry.js +2 -0
- package/dist/jaak-stamps-webcomponent/p-c06e5d7b.entry.js.map +1 -0
- package/dist/types/services/CameraService.d.ts +1 -0
- package/package.json +1 -1
- package/dist/jaak-stamps-webcomponent/p-a76ae84d.entry.js +0 -2
- package/dist/jaak-stamps-webcomponent/p-a76ae84d.entry.js.map +0 -1
|
@@ -204,7 +204,21 @@ class CameraService {
|
|
|
204
204
|
tempStream.getTracks().forEach(track => track.stop());
|
|
205
205
|
}
|
|
206
206
|
const devices = await navigator.mediaDevices.enumerateDevices();
|
|
207
|
-
|
|
207
|
+
const allCameras = devices.filter(device => device.kind === 'videoinput');
|
|
208
|
+
// Filter out virtual cameras
|
|
209
|
+
this.availableCameras = allCameras.filter(camera => {
|
|
210
|
+
const isVirtual = this.isVirtualCamera(camera);
|
|
211
|
+
if (isVirtual) {
|
|
212
|
+
console.log(`Virtual camera detected and filtered: ${camera.label}`);
|
|
213
|
+
}
|
|
214
|
+
return !isVirtual;
|
|
215
|
+
});
|
|
216
|
+
// Check if there are physical cameras available
|
|
217
|
+
if (this.availableCameras.length === 0) {
|
|
218
|
+
console.log('No physical cameras available');
|
|
219
|
+
this.eventBus.emit('error', new Error('Cámaras virtuales no están permitidas. Use una cámara física.'));
|
|
220
|
+
return [];
|
|
221
|
+
}
|
|
208
222
|
// Cache the results for optimization
|
|
209
223
|
CameraService.deviceEnumerationCache = {
|
|
210
224
|
devices: this.availableCameras,
|
|
@@ -254,6 +268,21 @@ class CameraService {
|
|
|
254
268
|
});
|
|
255
269
|
this.lastStreamConstraints = finalConstraints;
|
|
256
270
|
const stream = await this.currentStreamPromise;
|
|
271
|
+
// Validate that active stream is not from a virtual camera
|
|
272
|
+
const videoTrack = stream.getVideoTracks()[0];
|
|
273
|
+
if (videoTrack) {
|
|
274
|
+
const settings = videoTrack.getSettings();
|
|
275
|
+
const deviceId = settings.deviceId;
|
|
276
|
+
if (deviceId) {
|
|
277
|
+
const devices = await navigator.mediaDevices.enumerateDevices();
|
|
278
|
+
const currentDevice = devices.find(device => device.deviceId === deviceId);
|
|
279
|
+
if (currentDevice && this.isVirtualCamera(currentDevice)) {
|
|
280
|
+
console.log(`Virtual camera detected in active stream: ${currentDevice.label}`);
|
|
281
|
+
stream.getTracks().forEach(track => track.stop());
|
|
282
|
+
throw new Error('Cámaras virtuales no están permitidas. Use una cámara física.');
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
}
|
|
257
286
|
return stream;
|
|
258
287
|
}
|
|
259
288
|
catch (error) {
|
|
@@ -271,7 +300,23 @@ class CameraService {
|
|
|
271
300
|
audio: false
|
|
272
301
|
});
|
|
273
302
|
this.lastStreamConstraints = basicConstraints;
|
|
274
|
-
|
|
303
|
+
const stream = await this.currentStreamPromise;
|
|
304
|
+
// Validate fallback stream as well
|
|
305
|
+
const videoTrack = stream.getVideoTracks()[0];
|
|
306
|
+
if (videoTrack) {
|
|
307
|
+
const settings = videoTrack.getSettings();
|
|
308
|
+
const deviceId = settings.deviceId;
|
|
309
|
+
if (deviceId) {
|
|
310
|
+
const devices = await navigator.mediaDevices.enumerateDevices();
|
|
311
|
+
const currentDevice = devices.find(device => device.deviceId === deviceId);
|
|
312
|
+
if (currentDevice && this.isVirtualCamera(currentDevice)) {
|
|
313
|
+
console.log(`Virtual camera detected in fallback stream: ${currentDevice.label}`);
|
|
314
|
+
stream.getTracks().forEach(track => track.stop());
|
|
315
|
+
throw new Error('Cámaras virtuales no están permitidas. Use una cámara física.');
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
return stream;
|
|
275
320
|
}
|
|
276
321
|
}
|
|
277
322
|
async switchCamera(cameraId) {
|
|
@@ -280,6 +325,12 @@ class CameraService {
|
|
|
280
325
|
await this.enumerateDevices();
|
|
281
326
|
return;
|
|
282
327
|
}
|
|
328
|
+
// Validate that the target camera is not virtual
|
|
329
|
+
if (this.isVirtualCamera(selectedCamera)) {
|
|
330
|
+
console.log(`Attempted to switch to virtual camera: ${selectedCamera.label}`);
|
|
331
|
+
this.eventBus.emit('error', new Error('No se puede cambiar a cámara virtual'));
|
|
332
|
+
return;
|
|
333
|
+
}
|
|
283
334
|
await this.setSelectedCamera(cameraId);
|
|
284
335
|
}
|
|
285
336
|
isRearCamera(stream) {
|
|
@@ -551,6 +602,37 @@ class CameraService {
|
|
|
551
602
|
invalidateDeviceCache() {
|
|
552
603
|
CameraService.deviceEnumerationCache = null;
|
|
553
604
|
}
|
|
605
|
+
isVirtualCamera(device) {
|
|
606
|
+
const label = device.label.toLowerCase();
|
|
607
|
+
const virtualCameraIndicators = [
|
|
608
|
+
'obs',
|
|
609
|
+
'virtual',
|
|
610
|
+
'snap camera',
|
|
611
|
+
'manycam',
|
|
612
|
+
'xsplit',
|
|
613
|
+
'camtwist',
|
|
614
|
+
'ecamm',
|
|
615
|
+
'nvidia broadcast',
|
|
616
|
+
'droidcam',
|
|
617
|
+
'iriun',
|
|
618
|
+
'elgato',
|
|
619
|
+
'streamlabs',
|
|
620
|
+
'wirecast',
|
|
621
|
+
'zoom virtual',
|
|
622
|
+
'teams virtual',
|
|
623
|
+
'mmhmm',
|
|
624
|
+
'camo',
|
|
625
|
+
'reincubate camo',
|
|
626
|
+
'webcamoid',
|
|
627
|
+
'splitcam',
|
|
628
|
+
'cheese',
|
|
629
|
+
'guvcview',
|
|
630
|
+
'yawcam',
|
|
631
|
+
'webcam 7',
|
|
632
|
+
'altserver'
|
|
633
|
+
];
|
|
634
|
+
return virtualCameraIndicators.some(indicator => label.includes(indicator));
|
|
635
|
+
}
|
|
554
636
|
}
|
|
555
637
|
|
|
556
638
|
class LowMemoryDeviceStrategy {
|
|
@@ -1299,7 +1381,7 @@ const JaakStamps = class {
|
|
|
1299
1381
|
if (!window.ort) {
|
|
1300
1382
|
this.updateStatus('Preparando herramientas...', 'Configurando funciones de captura', 'initializing');
|
|
1301
1383
|
const script = document.createElement('script');
|
|
1302
|
-
script.src = 'https://cdn.jsdelivr.net/npm/onnxruntime-web/dist/ort.min.js';
|
|
1384
|
+
script.src = 'https://cdn.jsdelivr.net/npm/onnxruntime-web@1.23.0/dist/ort.min.js';
|
|
1303
1385
|
document.head.appendChild(script);
|
|
1304
1386
|
await new Promise((resolve) => {
|
|
1305
1387
|
script.onload = () => {
|
|
@@ -2106,7 +2188,7 @@ const JaakStamps = class {
|
|
|
2106
2188
|
isCapturing: false
|
|
2107
2189
|
};
|
|
2108
2190
|
const cameraInfo = this.cameraInfoWithAutofocus;
|
|
2109
|
-
return (h("div", { key: '
|
|
2191
|
+
return (h("div", { key: 'f9cbca2fd6b8548a29ace7fcb972b53f402f61af', class: "detector-container" }, h("div", { key: '4f3cac734eb6bfd44a8de644eadca17e7893e11a', class: "video-container" }, h("video", { key: '5e15a38c989a72d5274281272d41ba064447ca6f', ref: el => this.videoRef = el, autoplay: true, muted: true, playsinline: true, class: this.shouldMirrorVideo ? 'mirror' : '', style: { display: captureState.isVideoActive ? 'block' : 'none' } }), h("div", { key: '38c8ad8b691db60e9b5a2a8b641fe6febbeacfca', ref: el => this.detectionContainer = el, class: `detection-overlay ${this.shouldMirrorVideo ? 'mirror' : ''}` }, this.debug && this.detectionBoxes.map((box, index) => (h("div", { key: index, class: "detection-box", style: {
|
|
2110
2192
|
position: 'absolute',
|
|
2111
2193
|
left: `${box.x}px`,
|
|
2112
2194
|
top: `${box.y}px`,
|
|
@@ -2115,9 +2197,9 @@ const JaakStamps = class {
|
|
|
2115
2197
|
border: '2px solid #32406C',
|
|
2116
2198
|
pointerEvents: 'none',
|
|
2117
2199
|
boxSizing: 'border-box'
|
|
2118
|
-
} })))), this.isMaskReady && (h("div", { key: '
|
|
2200
|
+
} })))), this.isMaskReady && (h("div", { key: 'c56fde56b7a86a4e8a4cf558745291ea5cde12fd', class: "overlay-mask" }, h("div", { key: '04ed3f01f271dc84eed594cb4b60c2453645bd41', class: "card-outline" }, h("div", { key: '648bd423a5e886d4768115237de5896c7223b30b', class: "side side-top" }), h("div", { key: 'b8878059493ca61961b9b3c82ecc18b50b79ac85', class: "side side-right" }), h("div", { key: '09e5ad64ff33dbd5c112bf52b71e14409ab6aa65', class: "side side-bottom" }), h("div", { key: 'b8ba3d83c9bc1b4a0da859d7ed4b9a15eaddcc2a', class: "side side-left" })), !captureState.showFlipAnimation && !captureState.showSuccessAnimation && (h("div", { key: '3279701a240f77ac96e68a34ad95c099340c9a6a', class: `guide-text ${this.showPerformanceMessage ? 'performance-warning-text' : ''}` }, this.getGuideText(captureState.step))), captureState.step === 'back' && !captureState.showFlipAnimation && !captureState.showSuccessAnimation && (h("div", { key: '2adf96d0a57e482372fd9586229dac2301b64fd4', class: "back-capture-section" }, h("div", { key: '305a147c9cfee854c60ac946a48a1d21b2792725', class: "back-capture-buttons" }, (!this.useDocumentDetector || this.performanceDegradedMode || this.showManualCaptureButton) && (h("button", { key: '43270a0647f39307229c540dd5130fb58b1ff4fb', class: "capture-button primary-button", onClick: () => this.takeManualScreenshot(), type: "button", disabled: this.processingButton !== null }, this.processingButton === 'capture-back' && (h("span", { key: 'eb4666603774564eef95a120ac13faeb9e10c8b4', class: "button-spinner" })), "Capturar Reverso")), h("button", { key: 'cac667d9548ae2314ad5a677c5ed90f25184f728', class: "skip-button", onClick: () => this.skipBackCapture(), type: "button", disabled: this.processingButton !== null }, this.processingButton === 'skip-back' && (h("span", { key: '0af7aa4106ce189ae2d79bec78ede01abe25b1e7', class: "button-spinner" })), this.enableBackDocumentTimer && this.backDocumentTimerRemaining > 0
|
|
2119
2201
|
? `Saltar reverso (${this.backDocumentTimerRemaining}s)`
|
|
2120
|
-
: 'Saltar reverso')))), captureState.isVideoActive && (h("div", { key: '
|
|
2202
|
+
: 'Saltar reverso')))), captureState.isVideoActive && (h("div", { key: 'de6e5c4fad4d4d996b894457c9af52bc71e533fb', class: "camera-controls" }, h("button", { key: 'cfddcf2420d5f5923a6b02ca446bbe1b8e9fc5e4', class: `camera-selector-button ${this.isSwitchingCamera ? 'loading' : ''}`, onClick: () => this.toggleCameraSelector(), type: "button", title: "Seleccionar c\u00E1mara", disabled: this.isSwitchingCamera }, this.isSwitchingCamera ? (h("div", { class: "button-spinner" })) : ('Cámaras')))), this.showCameraSelector && cameraInfo.availableCameras.length > 0 && (h("div", { key: '5fb73f958b9a5a6f9242032c4530b0bdab84f6c5', class: "camera-selector-dropdown" }, h("div", { key: '8ee2d26b1001e571e7b6c326e927926fa08287fd', class: "camera-selector-header" }, h("span", { key: '78350b0fb1bd933f7c8c59d8dab0b7122ffbe363' }, "Seleccionar C\u00E1mara"), h("button", { key: 'bb750e0ddd5a1ee5ff96bd57805a7f90b8821e9f', class: "close-selector", onClick: () => this.toggleCameraSelector(), type: "button" }, "\u00D7")), h("div", { key: 'd0f6343cf1b7367f3da33ec8cf64891109d923b8', class: "camera-list" }, cameraInfo.availableCameras.map((camera) => (h("button", { key: camera.id, class: `camera-option ${cameraInfo.selectedCameraId === camera.id ? 'selected' : ''}`, onClick: () => this.handleCameraSwitch(camera.id), type: "button" }, h("span", { class: "camera-label" }, camera.label || `Cámara ${cameraInfo.availableCameras.indexOf(camera) + 1}`, camera.hasAutofocus && (h("span", { class: "autofocus-icon", title: "Autofoco disponible" }, "\u29BF"))), cameraInfo.selectedCameraId === camera.id && (h("span", { class: "selected-indicator" }, "\u2713")))))), h("div", { key: 'c9642fbfb0acea766d3f0542f4cc9f17f4af4d7b', class: "device-info" }, h("small", { key: 'b6e9507ff7addf011f339f6c22a88a96b40db68a' }, "Dispositivo: ", cameraInfo.deviceType)))), this.showManualCaptureButton && captureState.step === 'front' && !captureState.showFlipAnimation && !captureState.showSuccessAnimation && (h("div", { key: '04ae9262409284782850b90945eb7038673e2097', class: "manual-capture-section" }, h("button", { key: '27c315e503ccba468b89ebd58d6b70f40ddd06ba', class: "manual-capture-button", onClick: () => this.takeManualScreenshot(), type: "button", disabled: this.processingButton !== null }, this.processingButton === 'capture-front' && (h("span", { key: '8f2dcd2df9a218b37eb0b8204a8724362cfeaa53', class: "button-spinner" })), "Capturar Frente"))))), captureState.isCapturing && (h("div", { key: '6fd6fe1d0213b01c8119a67fb8108f73227feee1', class: "capture-animation" })), captureState.showFlipAnimation && (h("div", { key: 'fba3816b48b99ca64510ecbefc0d41431569c9ae', class: "flip-animation" }, h("div", { key: 'beea1c8245b5d81f1008efc6d1b079a61c821e7f', class: "id-card-icon" }), h("div", { key: 'f0fbc34f619a653e2c0ade764ca99e7aa582d157', class: "flip-text" }, "\u00A1Voltea tu identificaci\u00F3n!"))), captureState.showSuccessAnimation && (h("div", { key: 'e4a0e6d31112e3a50024d1d0430b4ad997049fe7', class: "success-animation" }, h("div", { key: '5dd3f781f55630bc904c81207548ae35bc79b452', class: "check-icon" }), h("div", { key: 'a10ebc557582325091efb0abd12d62b27a43b98c', class: "success-text" }, "\u00A1Proceso completado!"))), h("div", { key: '975865955dee1803b5215ecf049701c98b324855', class: `component-status status-${this.currentStatus.type}` }, (this.currentStatus.type === 'loading' || this.currentStatus.type === 'initializing') && (h("div", { key: '84f6f67202e26ce80f7fc5d5f321e23b5bc55c57', class: "status-spinner" })), h("div", { key: 'a1ae56ed156e8feb279a1bf160f749c5d0b5ce45', class: "status-content" }, h("div", { key: 'd62932554cea257ce19763df26e0ba702e50eeca', class: "status-message" }, this.currentStatus.message), this.currentStatus.description && (h("div", { key: 'c5506fa12dd0d37d26dc26c9f2381c843330451f', class: "status-description" }, this.currentStatus.description)))), this.debug && (h("div", { key: '2097eda63185f336f7319014fae2ef6db1e41761', class: "performance-monitor" }, h("div", { key: 'd611c494c6b1a5930ef64aebdcba41e5d94c9ee6', class: "performance-expanded" }, h("div", { key: '800d46831e7b9bec260d9c5e67ea1a3eb9c2933e', class: "metrics-row" }, h("div", { key: 'dd0db1faa9050d98e71da4b5cd26a4a484c37c64', class: "metric-compact" }, h("span", { key: 'f0e6ea61a35ddb2ae5c2a6aff8c255a02c5c1219', class: "metric-label" }, "FPS"), h("span", { key: 'cbf4df4d142f6f01e45f566a8ede8fbbf29ad673', class: `metric-value ${this.performanceData.fps < 15 ? 'warning' : this.performanceData.fps < 10 ? 'danger' : 'good'}` }, this.performanceData.fps)), h("div", { key: '83861ad31fa46c8199a5583e4b3f8eefd44bacd6', class: "metric-compact" }, h("span", { key: '41b8de4cda47959dfc9df393e95fdadde534dd21', class: "metric-label" }, "MEM"), h("span", { key: 'b268f13cc78066e240ed158f1443113a94827aff', class: `metric-value ${this.performanceData.memoryUsage > 100 ? 'warning' : this.performanceData.memoryUsage > 200 ? 'danger' : 'good'}` }, this.performanceData.memoryUsage, "MB"))), h("div", { key: '9f9a9d0690906b186492af23b900c5fa0f5cff89', class: "metrics-row" }, h("div", { key: '84fa6e453dc36e4a74e8b573447b17230766229e', class: "metric-compact" }, h("span", { key: 'f17d52899090c89f532d74c552dd8c5338fc2d83', class: "metric-label" }, "INF"), h("span", { key: '2beca0d7ce55ed574f6b01efc086c5846983e024', class: `metric-value ${this.performanceData.inferenceTime > 100 ? 'warning' : this.performanceData.inferenceTime > 200 ? 'danger' : 'good'}` }, this.performanceData.inferenceTime, "ms")), h("div", { key: '981e300cf076e81bfe946974f6cffd63619eacde', class: "metric-compact" }, h("span", { key: '3dfb0c996a69eb87b0f711322675cad69c471146', class: "metric-label" }, "FRAME"), h("span", { key: '3ae2ac6e90cda77f23e559f3197c3b761f9bdc40', class: `metric-value ${this.performanceData.frameProcessingTime > 50 ? 'warning' : this.performanceData.frameProcessingTime > 100 ? 'danger' : 'good'}` }, this.performanceData.frameProcessingTime, "ms"))), h("div", { key: '2c51216838d87728d9d7764e5ba8a50fa02eb493', class: "metrics-row" }, h("div", { key: 'eda810ffb80ec38ab84583f59b26706f90a50fc9', class: "metric-compact" }, h("span", { key: '978ba9c0c67d6da6b29b3535af33a314bab9276a', class: "metric-label" }, "DET"), h("span", { key: '3e5e169fd4a3906283d8f918b5bbc7c5df6ccd0f', class: "metric-value good" }, this.performanceData.successfulDetections, "/", this.performanceData.totalDetections)), h("div", { key: 'b4b915c745e35c09470a4dc5edfc112d32cfb8b6', class: "metric-compact" }, h("span", { key: '3e2a7b88a4446813c955efb0dfa9e2958e8e1448', class: "metric-label" }, "RATE"), h("span", { key: 'f4f073f7ee622167a241c6a1c535ef580c13d9ab', class: `metric-value ${this.performanceData.detectionRate < 30 ? 'danger' : this.performanceData.detectionRate < 60 ? 'warning' : 'good'}` }, this.performanceData.detectionRate, "%")))))), h("div", { key: '76c556e92f6d7980539f1a30efe8751f665164fb', class: "watermark" }, h("img", { key: 'af23e115d6b4e92a72e55d6d98fde0e4b1d09e9b', src: "https://storage.googleapis.com/jaak-static/commons/powered-by-jaak.png", alt: "Powered by Jaak" })))));
|
|
2121
2203
|
}
|
|
2122
2204
|
// Utility methods
|
|
2123
2205
|
updateDetectionBoxes(boxes) {
|
|
@@ -2314,8 +2396,8 @@ const JaakStamps = class {
|
|
|
2314
2396
|
if (captureState.step === 'front') {
|
|
2315
2397
|
this.stateManager.setCapturedImages({
|
|
2316
2398
|
front: {
|
|
2317
|
-
fullFrame: captureCanvas.toDataURL('image/
|
|
2318
|
-
cropped: croppedCanvas.toDataURL('image/
|
|
2399
|
+
fullFrame: captureCanvas.toDataURL('image/jpeg'),
|
|
2400
|
+
cropped: croppedCanvas.toDataURL('image/jpeg')
|
|
2319
2401
|
}
|
|
2320
2402
|
});
|
|
2321
2403
|
// Check if document classification is enabled (independent of detector)
|
|
@@ -2355,8 +2437,8 @@ const JaakStamps = class {
|
|
|
2355
2437
|
else if (captureState.step === 'back') {
|
|
2356
2438
|
this.stateManager.setCapturedImages({
|
|
2357
2439
|
back: {
|
|
2358
|
-
fullFrame: captureCanvas.toDataURL('image/
|
|
2359
|
-
cropped: croppedCanvas.toDataURL('image/
|
|
2440
|
+
fullFrame: captureCanvas.toDataURL('image/jpeg'),
|
|
2441
|
+
cropped: croppedCanvas.toDataURL('image/jpeg')
|
|
2360
2442
|
}
|
|
2361
2443
|
});
|
|
2362
2444
|
this.completeProcess(false);
|
|
@@ -2394,8 +2476,8 @@ const JaakStamps = class {
|
|
|
2394
2476
|
if (captureState.step === 'front') {
|
|
2395
2477
|
this.stateManager.setCapturedImages({
|
|
2396
2478
|
front: {
|
|
2397
|
-
fullFrame: captureCanvas.toDataURL('image/
|
|
2398
|
-
cropped: croppedCanvas.toDataURL('image/
|
|
2479
|
+
fullFrame: captureCanvas.toDataURL('image/jpeg'),
|
|
2480
|
+
cropped: croppedCanvas.toDataURL('image/jpeg')
|
|
2399
2481
|
}
|
|
2400
2482
|
});
|
|
2401
2483
|
// Check if document classification is enabled
|
|
@@ -2427,8 +2509,8 @@ const JaakStamps = class {
|
|
|
2427
2509
|
else if (captureState.step === 'back') {
|
|
2428
2510
|
this.stateManager.setCapturedImages({
|
|
2429
2511
|
back: {
|
|
2430
|
-
fullFrame: captureCanvas.toDataURL('image/
|
|
2431
|
-
cropped: croppedCanvas.toDataURL('image/
|
|
2512
|
+
fullFrame: captureCanvas.toDataURL('image/jpeg'),
|
|
2513
|
+
cropped: croppedCanvas.toDataURL('image/jpeg')
|
|
2432
2514
|
}
|
|
2433
2515
|
});
|
|
2434
2516
|
this.completeProcess(false);
|
|
@@ -2554,10 +2636,13 @@ const JaakStamps = class {
|
|
|
2554
2636
|
this.useDocumentDetector = false; // Desactivar detector automático
|
|
2555
2637
|
// Actualizar el estado con mensaje de error
|
|
2556
2638
|
this.updateStatus('Modo manual activado', errorMessage, 'error');
|
|
2557
|
-
//
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2639
|
+
// Continuar con la configuración de cámara para mostrar el video
|
|
2640
|
+
this.continueWithCameraSetup().catch(() => {
|
|
2641
|
+
// Si falla la configuración de cámara, mantener el mensaje de error pero cambiar el estado
|
|
2642
|
+
setTimeout(() => {
|
|
2643
|
+
this.updateStatus('Captura manual', 'Use el botón para capturar', 'ready');
|
|
2644
|
+
}, 5000);
|
|
2645
|
+
});
|
|
2561
2646
|
}
|
|
2562
2647
|
stopPerformanceMonitoring() {
|
|
2563
2648
|
// Nota: No necesitamos limpiar más variables porque ya no se usarán
|
|
@@ -2644,6 +2729,12 @@ const JaakStamps = class {
|
|
|
2644
2729
|
try {
|
|
2645
2730
|
// Close the selector immediately when user selects a camera
|
|
2646
2731
|
this.showCameraSelector = false;
|
|
2732
|
+
// Check if user selected the same camera that's already active
|
|
2733
|
+
const currentCameraId = this.cameraService.getSelectedCameraId();
|
|
2734
|
+
if (currentCameraId === cameraId) {
|
|
2735
|
+
// Same camera selected, just close the selector without switching
|
|
2736
|
+
return;
|
|
2737
|
+
}
|
|
2647
2738
|
this.isSwitchingCamera = true;
|
|
2648
2739
|
// Stop current video stream
|
|
2649
2740
|
if (this.videoStream) {
|