Bug 221752

Summary: enumerateDevices does only returns one videoinput device for multi-lense devices
Product: WebKit Reporter: Matthias Rauch <matthias.rauch>
Component: WebRTCAssignee: Nobody <webkit-unassigned>
Status: NEW    
Severity: Normal CC: boghyon+webkit, moritz.zimmermann, rychouwei, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: Safari 14   
Hardware: iPhone / iPad   
OS: iOS 14   

Matthias Rauch
Reported 2021-02-11 06:47:57 PST
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.
Attachments
Matthias Rauch
Comment 1 2021-02-12 00:13:06 PST
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?
Radar WebKit Bug Importer
Comment 2 2021-02-18 06:48:15 PST
Note You need to log in before you can comment on or make changes to this bug.