mirror of
https://gitlab.com/soapbox-pub/mkstack.git
synced 2026-12-05 16:33:36 +00:00
default to back camera
This commit is contained in:
1 parent
a432716f47
commit
204fc46c48
1 file changed
+2
-2
@@ -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
|
||||
|
||||
Reference in new issue
Block a user