Changed logic in ocr for capture

This commit is contained in:
dhanabalan
2025-10-18 09:51:31 +05:30
parent a621df56fd
commit 095aac2270

View File

@@ -203,6 +203,7 @@ document.addEventListener('DOMContentLoaded', () => {
try { try {
this.stream = await navigator.mediaDevices.getUserMedia({ this.stream = await navigator.mediaDevices.getUserMedia({
video: { video: {
facingMode: this.currentFacingMode, // 'user' or 'environment'
width: { ideal: 1920 }, width: { ideal: 1920 },
height: { ideal: 1080 }, height: { ideal: 1080 },
}, },
@@ -215,6 +216,7 @@ document.addEventListener('DOMContentLoaded', () => {
} }
async switchCamera() { async switchCamera() {
this.currentFacingMode = this.currentFacingMode === 'user' ? 'environment' : 'user'; this.currentFacingMode = this.currentFacingMode === 'user' ? 'environment' : 'user';
await this.initCamera(); await this.initCamera();