Steps to reproduce: 1. Have two or more available microphones 2. Call getUserMedia and then enumerateDevices: browser will return a list of devices, where first one is default 2. Change microphone is system preference 3. Call enumerateDevices again: first one in the list is a previous default device Js fiddler to show the issue: https://jsfiddle.net/h38bn7zq/15/ Note: if device is unplugged then enumerateDevices returns correct info, it works correct also when device was plugged in after.
<rdar://problem/56648063>
I can repro the bug. On page reload, the default device is the correct one. There is apparently no device change event being fired, which means we either do not receive the notification or we do not detect any change in the device setup while we should.
Created attachment 382738 [details] Patch
Comment on attachment 382738 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=382738&action=review > Source/WebCore/platform/mediastream/mac/CoreAudioCaptureDeviceManager.cpp:131 > + callOnMainThread([] { We probably do not need callOnMainThread since we ask the listener to be called on dispatch_get_main_queue.
Created attachment 382740 [details] Patch for landing.
Comment on attachment 382740 [details] Patch for landing. Clearing flags on attachment: 382740 Committed r251992: <https://trac.webkit.org/changeset/251992>
All reviewed patches have been landed. Closing bug.