default to back camera

This commit is contained in:
lemonknowsall committed 2025-10-27 08:20:26 -07:00
1 parent a432716f47
commit 204fc46c48
1 file changed
+2 -2
+2 -2
View File
@@ -109,9 +109,9 @@ export function useQRCode(): UseQRCodeReturn {
throw new Error('No cameras found');
}
// Use the back camera by default, or first available
// Use the rear camera by default, or first available
const cameraId = devices.length > 1
? devices.find(d => d.label.includes('back'))?.id || devices[0].id
? devices.find(d => d.label.toLowerCase().includes('back') || d.label.toLowerCase().includes('rear') || d.label.toLowerCase().includes('environment'))?.id || devices[0].id
: devices[0].id;
// Initialize scanner