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}
|
||||
videoConstraints={{
|
||||
deviceId: selectedDeviceId ? { exact: selectedDeviceId } : undefined,
|
||||
facingMode: { ideal: "environment" },
|
||||
...(selectedDeviceId ? {} : { facingMode: { ideal: "environment" } }),
|
||||
}}
|
||||
onUserMedia={async () => {
|
||||
const newDevices = await navigator.mediaDevices.enumerateDevices();
|
||||
|
|
|
|||
Loading…
Reference in a new issue