Bug 209739 - iOS 13.4 enumerateDevices() does not report the camera after the first call
Summary: iOS 13.4 enumerateDevices() does not report the camera after the first call
Status: RESOLVED DUPLICATE of bug 209417
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebRTC (show other bugs)
Version: Safari 13
Hardware: Unspecified iOS 13
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-03-30 07:24 PDT by milen
Modified: 2020-03-30 07:32 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description milen 2020-03-30 07:24:54 PDT
Tested on iPhone 7, iOS 13.4

Open Mobile Safari and go to https://milen-yordanov.github.io/webrtc-ios13_4-enumerateDevices/

The first call to enumerateDevices() reports two devices: videoinput and audioinput.

The second call to enumerateDevices() reports two devices: audioinput and audioinput. There is no videoinput!

The code to reproduce it is as simple as:

await navigator.mediaDevices.enumerateDevices()
await navigator.mediaDevices.enumerateDevices()
 

See: https://raw.githubusercontent.com/milen-yordanov/webrtc-ios13_4-enumerateDevices/master/index.html

Older iOS 13.x and 12.x did not have this issue.
Comment 1 youenn fablet 2020-03-30 07:26:41 PDT
This is a dupe of bug 209417 which is now fixed in WebKit ToT.

*** This bug has been marked as a duplicate of bug 209417 ***
Comment 2 youenn fablet 2020-03-30 07:32:31 PDT
There are a number of workarounds:
- On iOS, all devices running Safari should have a camera.
- Add a shim to enumerateDevices so as to buffer the result of enumerateDevices until capture is granted/devicechange event is fired.