Added logic in camera in ocr

This commit is contained in:
dhanabalan
2025-10-27 11:05:47 +05:30
parent 403fc503f9
commit d22b060ec8

View File

@@ -837,15 +837,15 @@ function cameraCapture() {
this.$refs.hiddenInput.value = snapshotData;
this.capturedPhoto = snapshotData;
// Stop the camera stream
if (this.stream) this.stream.getTracks().forEach(track => track.stop());
// ✅ Hide video + overlay, show captured snapshot
// ✅ Hide live video immediately → prevents black frame
video.classList.add('hidden');
overlay.classList.add('hidden');
// Stop camera stream after hide
if (this.stream) this.stream.getTracks().forEach(track => track.stop());
snapshot.src = snapshotData;
snapshot.classList.remove('hidden');
this.stopDetection();
},