diff --git a/resources/views/fields/camera-capture.blade.php b/resources/views/fields/camera-capture.blade.php index 75435a1..b08ec01 100644 --- a/resources/views/fields/camera-capture.blade.php +++ b/resources/views/fields/camera-capture.blade.php @@ -837,16 +837,16 @@ 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 live video immediately → prevents black frame +video.classList.add('hidden'); +overlay.classList.add('hidden'); - // ✅ Hide video + overlay, show captured snapshot - video.classList.add('hidden'); - overlay.classList.add('hidden'); - snapshot.src = snapshotData; - snapshot.classList.remove('hidden'); +// Stop camera stream after hide +if (this.stream) this.stream.getTracks().forEach(track => track.stop()); - this.stopDetection(); +snapshot.src = snapshotData; +snapshot.classList.remove('hidden'); +this.stopDetection(); },