We developed a website where are able to scan barcodes via WebRTC. Since barcode scanning does not work well with wide-angle cameras, we also added a small feature where the user can select the camera to use for scanning. To achieve this we list all cameras returned from navigator.mediaDevices.enumerateDevices() for the user to choose from. The chosen deviceId is then passed in the constraints to navigator.mediaDevices.getUserMedia(). This works well on Android devices, because navigator.mediaDevices.enumerateDevices() returns multiple videoinput devices for the back facing cameras where one of them is always the telelens (=non wide-angle) camera. In contrast navigator.mediaDevices.enumerateDevices() on iOS 14 only ever returns two videoinput devices (front camera, back camera). That is also the case for devices like iPhone 11 or iPhone 7 Plus where multiple back-facing lenses are available. This is especially a problem with iPhone 7 Plus where the wide-angle camera is selected as the default back camera and cannot be changed by the user.
Are there any plans to return multiple devices for the different lenses as Chrome on Android does? Is there any way to force the use of telelens camera on iPhone 7 Plus as back camera?
<rdar://problem/74476182>