Description of the issue:
The ordering of the output of navigator.mediaDevices.enumerateDevices
is incorrect.
Also reported at https://github.com/brave/brave-browser/issues/12435.
How can this issue be reproduced?
- Open the Javascript console.
- Type
await navigator.mediaDevices.getUserMedia({video: true, audio: true}).then(() => navigator.mediaDevices.enumerateDevices());
- Get the following result, which is clearly incorrect:
0: InputDeviceInfo {deviceId: "0fc552c227690aaf7d20ca3cdb8ed2e6beef6e2248c1aa4619613ce6eb6bb3f3", groupId: "740aef2fec7f34042ec6640fc0c932f5900674ede3071f2e80d6d3870a37a102", kind: "videoinput", label: "Integrated Webcam (0bda:568c)"}
1: MediaDeviceInfo {deviceId: "1a642d82e10f87adfad771aeba6a888b49e478c62c61e44fce7b54507179ec44", groupId: "59075f124bf2234595e1aff76e3375b168abd346ee675de44e5f2f5bcca327ab", kind: "audiooutput", label: "HDA Intel PCH, HDMI 1-Hardware device with all software conversions"}
2: MediaDeviceInfo {deviceId: "144221e8eea03f0696b1c82451f8d2625a2b2cc8bbd5c18eb270133410b21d5a", groupId: "7988bea836772ad9392f404424f2772b82d6cfd440cf5cfbc82c7e97326a89e2", kind: "audiooutput", label: "HDA Intel PCH, HDMI 2-Hardware device with all software conversions"}
3: InputDeviceInfo {deviceId: "6c5a490972cebd9df997ab672ae2784d398132b75770fe0af7937004c70cb42f", groupId: "9be6aef74946bb6893056477e8db00e04545f2f0bf7a86bbacde76cace85885e", kind: "audioinput", label: "HDA Intel PCH, ALC3246 Analog-Direct sample snooping device"}
4: InputDeviceInfo {deviceId: "2a647f645ea2ab40a523a70e9800a7890716f6ba893777be2b9d8d721b4a300b", groupId: "08596f44ba7440b7e7905d31257f51611826fde546305047bcc2183c20bb1ffc", kind: "audioinput", label: "HDA Intel PCH, ALC3246 Analog-Default Audio Device"}
5: MediaDeviceInfo {deviceId: "704e1038c3e88c3fa406db9e46c63122d7aaf6e9a085da45d5e9a4d60db05a0f", groupId: "8485a0fcef77a940835e8796563f9c1c5d5d458348915e5325c3bcfbe9a819f4", kind: "audiooutput", label: "HDA Intel PCH, HDMI 0-Hardware device with all software conversions"}
6: MediaDeviceInfo {deviceId: "cd564c45dabdc545f156a44bbfa9dafeab08e2242a958818b73caa361457e2d5", groupId: "4d957bc4cd8adb282d67ced761c9d944312ea348b0526a0c4e5725389aa457c3", kind: "audiooutput", label: "HDA Intel PCH, HDMI 4-Hardware device with all software conversions"}
7: MediaDeviceInfo {deviceId: "0de8f80acf90f9bd2bf433560c41ccc872a1e9cd55273f59c3f1163e2ee6be5b", groupId: "7c345cf5186cd03aa1c741b32f8eecfc3e82e4664da21e5fe3c23594cadb311a", kind: "audiooutput", label: "HDA Intel PCH, HDMI 3-Hardware device with all software conversions"}
8: InputDeviceInfo {deviceId: "default", groupId: "cb57d6753fca92ec9e1becaf54a33de07228cef1b6a40c8fb711b98ac409072f", kind: "audioinput", label: "Default"}
9: InputDeviceInfo {deviceId: "818e388869a6687ec91278ae2e3d0d233c96234aea6fb950b403bb4e7c3a58c1", groupId: "a40424bd03d8c52565ae6f54bafef5ae082f8b40c9c65acc66bc28866a9e93e6", kind: "audioinput", label: "HDA Intel PCH-USB Stream Output"}
10: InputDeviceInfo {deviceId: "b204d2090258b8fce1e4c98f59e81ea190a7addc868a800c7a7720c5c9ad29bf", groupId: "fbdd9f40445313ee91b7f685ad20ddc3c3a946372798b31f36a084c2cdf1a92e", kind: "audioinput", label: "HDA Intel PCH, ALC3246 Analog-Direct hardware device without any conversions"}
11: MediaDeviceInfo {deviceId: "896fa40b07fc71fab897360e863aae78d6c18978353ef4c78d2349e209204dd5", groupId: "b6b40e2438b53b10cf3f5a69b606de43d4c35cc4f796f35c60d6623439862515", kind: "audiooutput", label: "HDA Intel PCH, ALC3246 Analog-Hardware device with all software conversions"}
12: InputDeviceInfo {deviceId: "7402dc054b0814c8bb6390efe4b6918e879d7b15bfa9c93dc9c9034fa440b158", groupId: "e3cb5543e4bbcaf2a7b8b53cfdc841581144ed2ff77ef3e6bab9027e7233e46c", kind: "audioinput", label: "HDA Intel PCH, ALC3246 Analog-Front output / input"}
13: InputDeviceInfo {deviceId: "896fa40b07fc71fab897360e863aae78d6c18978353ef4c78d2349e209204dd5", groupId: "8c5f81452f36a4df03d1e164198302f6935ca03343eef74ba7ff12f000d1f343", kind: "audioinput", label: "HDA Intel PCH, ALC3246 Analog-Hardware device with all software conversions"}
14: MediaDeviceInfo {deviceId: "default", groupId: "default", kind: "audiooutput", label: "Default"}
Expected result:
According to https://w3c.github.io/mediacapture-main/#dom-mediadevices-enumeratedevices paragraph 7.3, the default microphone should be at the beginning of the list. This is the case in both Chrome and Firefox.
Brave Version( check About Brave
):
1.15.76 Chromium: 86.0.4240.111 (Official Build) (64-bit)
Additional Information:
This breaks video conferencing applications that pick the first microphone in the list by default.