As part of a react web app, we use the Zxing library to perform barcode and qr code scans. However, we encounter a problem with the iphone 13 which sets the zoom to x1 by default, which results in a blurred image when we get closer to the elements to be scanned. We would like to configure the zoom to x0.5 (as is possible in the native iphone app), but I can't find a solution compatible with ios. If you have any ideas, I'm all ears. Thanks in advance.
`
if(!navigator?.mediaDevices?.getUserMedia){
onError && onError('Cannot stream camera')
return
}
let userMediaStream: MediaStream
navigator.mediaDevices.getUserMedia({ audio: false, video: { facingMode: 'environment'}})
.then(stream => {
userMediaStream = stream
if(!videoRef?.current){
onError && onError('video ref missing')
return
}
videoRef.current.srcObject = stream
})
return () => {
if(userMediaStream) {
userMediaStream.getTracks().forEach(t => t.stop())
}
}
`
I've already tried listing the supportedConstraints:
`
const constraintList = new Array();
const supportedConstraints = navigator.mediaDevices.getSupportedConstraints();
for (const constraint of Object.keys(supportedConstraints)) {
constraintList.push(constraint);
}
console.log(constraintList);
`
But I get no element allowing me to modify the zoom or the focus: ['aspectRatio', 'deviceId', 'echoCancellation', 'facingMode', 'frameRate', 'groupId', 'height', 'sampleRate', ' sampleSize', 'volume', 'width']