Bug 174041

Summary: Calling mediaDevices.enumerateDevices() changes enumerated device IDs in other open pages
Product: WebKit Reporter: lepinski
Component: MediaAssignee: Nobody <webkit-unassigned>
Status: NEW    
Severity: Normal CC: eric.carlson, jond, jonlee, lepinski, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: Safari Technology Preview   
Hardware: Mac   
OS: macOS 10.12.4   
URL: https://s3.amazonaws.com/safari-devices-testing/index.html

lepinski
Reported 2017-06-30 14:41:32 PDT
This appears to be a regression introduced in the most recent Safari Technology Preview (Release 34, 12604.1.27.0.1). On load, call navigator.mediaDevices.enumerateDevices() and note the device IDs in the source list. Open a new page (leaving the first page open) that also makes an enumerateDevices call. Return to the first page and enumerate your devices again; their IDs will have changed. This appears to occur regardless of whether Page 1 and 2 are on the same or different domains. The result of this bug is that when Page 1 attempts to then use an input device ID from its first enumeration as a getUserMedia constraint, the call will fail because the device ID is invalid. navigator.mediaDevices.ondevicechange also not called when these device IDs change as a result of this.
Attachments
Radar WebKit Bug Importer
Comment 1 2017-07-01 00:05:18 PDT
lepinski
Comment 2 2017-08-30 11:40:13 PDT
I've tested this issue in Release 38 and it's still happening. I've got an easy repro test page available here: https://s3.amazonaws.com/safari-devices-testing/index.html; to reproduce: * open the above page, click "Enumerate devices"; note device IDs * (optional: click "Enumerate devices" again; note that IDs haven't changed) * open a second page to the same URL, click "Enumerate devices" there * return to first page, click "Enumerate devices" again; you'll be prompted to re-authorize microphone access, and you'll be given a new set of device IDs
Note You need to log in before you can comment on or make changes to this bug.