lukegbcom: ee-qrcode should use back camera by default

This commit is contained in:
Luke Granger-Brown 2022-05-01 15:01:00 +01:00
parent 828c7ad578
commit 5193dd028a

View file

@ -18,7 +18,7 @@ async function startCapture(video, canvas, captureType) {
if (captureType === 'screen')
captureStream = await navigator.mediaDevices.getDisplayMedia({ audio: false, video: true })
else
captureStream = await navigator.mediaDevices.getUserMedia({ audio: false, video: true })
captureStream = await navigator.mediaDevices.getUserMedia({ audio: false, video: { facingMode: 'environment' } })
} catch (e) {
alert(`Failed to start screen capture: ${e}`)
return