Open ahuvia opened 3 years ago
The facingMode should be in the constraints:
<QrReader
onResult={(result, error) => {
if (!!result) {
setData(result?.text);
}
if (!!error) {
console.info(error);
}
}}
style={{ width: '100%' }}
constraints={{
facingMode: "environment"
}}
/>
So, for example Samsung phones have several cameras facing environment. How do I choose the "main" camera over the wide angle? Is there a way to force which device is being used somehow?
i have android, xioami. i define the facingMode as environment and it always went to the front I tried too: rear, back. <QrReader delay={delay} style={previewStyle} facingMode="environment" onError={(err)=>handleError(err)} onScan={(res) => { console.log(res) if(res) setresult(res.text) }} />
thank!