3 ms·
It's been a little while since I used this, but navigator.mediaDevices.enumerateDevices will give you that list, allowing you to have a menu for a user to choo
by throwaway40324 7y ago
It's been a little while since I used this, but navigator.mediaDevices.enumerateDevices
will give you that list, allowing you to have a menu for a user to choose one and then the client code must use setSinkId to assign the chosen device id. https://developer.mozilla.org/en-US/docs https://developer.mozilla.org/en-US/docs
- sriku 7y agoThe IDs you get (both deviceID and groupID) are not user displayable. They're like random numbers. In normal browsing mode, you keep getting the same deviceIDs for the same domain, but random groupIDs for every refresh. You get different deviceIDs for different sites. In private browsing mode, you get both random every time.
- throwaway40324 7y agoAh, I forgot that the device label is only returned when there is an active stream. And has zero support in Safari. https://developer.mozilla.org/en-US/docs/Web/API/MediaDeviceInfo/label https://developer.mozilla.org/en-US/docs/Web/API/MediaDevice... I never knew the device ids were randomized like that, thanks for the info.