diff --git a/resources/views/fields/camera-capture.blade.php b/resources/views/fields/camera-capture.blade.php index 23148fe..80615f4 100644 --- a/resources/views/fields/camera-capture.blade.php +++ b/resources/views/fields/camera-capture.blade.php @@ -203,6 +203,7 @@ document.addEventListener('DOMContentLoaded', () => { try { this.stream = await navigator.mediaDevices.getUserMedia({ video: { + facingMode: this.currentFacingMode, // 'user' or 'environment' width: { ideal: 1920 }, height: { ideal: 1080 }, }, @@ -215,6 +216,7 @@ document.addEventListener('DOMContentLoaded', () => { } + async switchCamera() { this.currentFacingMode = this.currentFacingMode === 'user' ? 'environment' : 'user'; await this.initCamera();