- From: guest271314 via GitHub <sysbot+gh@w3.org>
- Date: Wed, 12 Aug 2020 17:26:32 +0000
- To: public-webrtc-logs@w3.org
The prompt for Mozilla `getUserMedia()` is an example of how `enumerateDevices()` would work to both grant permissions (or not) and select any and all devices at a multiple select element (HTML; GTK; Qt, etc.)

where in _code_ then filters the list from `enumerateDevices()` and sets the filtered list, something like
```
enumerateDevices()
.then(devices => {
const filteredDevices = devices.filter(device => <conditions>);
const orderedDevices = devices.sort((a, b) => <conditions>);
filteredDevices is essentially user permission for the device(s), or not when not selected
return navigator.mediaDevices.getUserMedia(filteredDevices <converted_to_constraints>);
})
.then(stream => {
// devices selected at filteredDevices in order set by orderedDevices, 0 of audio and/or video default
// remainder of list not primary MediaStreamTrack's yet still exposed and capable of being adjusted in MediaStream
// using enabled, removeTrack, addTrack
console.log(stream);
})
// implementation refuses to capture device, etc.
.catch(console.error);
```
--
GitHub Notification of comment by guest271314
Please view or discuss this issue at https://github.com/w3c/mediacapture-main/issues/709#issuecomment-673008268 using your GitHub account
--
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Wednesday, 12 August 2020 17:26:38 UTC