Re: [mediacapture-main] Bug in spec: circular dependency for enumerateDevices() (#709)

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.)

![Screenshot_2020-08-12_16-48-06](https://user-images.githubusercontent.com/4174848/90046388-eb229d80-dcbf-11ea-95c0-7f38e860e66b.png)

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