Bug 221752 - enumerateDevices does only returns one videoinput device for multi-lense devices
Summary: enumerateDevices does only returns one videoinput device for multi-lense devices
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebRTC (show other bugs)
Version: Safari 14
Hardware: iPhone / iPad iOS 14
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-02-11 06:47 PST by Matthias Rauch
Modified: 2023-11-03 04:21 PDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Rauch 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.
Comment 1 Matthias Rauch 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?
Comment 2 Radar WebKit Bug Importer 2021-02-18 06:48:15 PST
<rdar://problem/74476182>