|Summary:||Calling mediaDevices.enumerateDevices() changes enumerated device IDs in other open pages|
|Severity:||Normal||CC:||eric.carlson, jond, jonlee, lepinski, webkit-bug-importer, youennf|
|Version:||Safari Technology Preview|
Description lepinski 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.
Comment 2 lepinski 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