Bug 174041
Summary: | Calling mediaDevices.enumerateDevices() changes enumerated device IDs in other open pages | ||
---|---|---|---|
Product: | WebKit | Reporter: | lepinski |
Component: | Media | Assignee: | 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
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 | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/33092067>
lepinski
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