fix: remove facingMode when selectedDeviceId is present
This commit is contained in:
parent
a37bde9d6c
commit
35a8996054
1 changed files with 1 additions and 1 deletions
|
|
@ -205,7 +205,7 @@ export default function QrScanner({ isOpen, setIsOpen, setQrBytesRaw }: Props) {
|
||||||
audio={false}
|
audio={false}
|
||||||
videoConstraints={{
|
videoConstraints={{
|
||||||
deviceId: selectedDeviceId ? { exact: selectedDeviceId } : undefined,
|
deviceId: selectedDeviceId ? { exact: selectedDeviceId } : undefined,
|
||||||
facingMode: { ideal: "environment" },
|
...(selectedDeviceId ? {} : { facingMode: { ideal: "environment" } }),
|
||||||
}}
|
}}
|
||||||
onUserMedia={async () => {
|
onUserMedia={async () => {
|
||||||
const newDevices = await navigator.mediaDevices.enumerateDevices();
|
const newDevices = await navigator.mediaDevices.enumerateDevices();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue