Re: [mediacapture-main] Racy devicechange event design has poor interoperability (#972)

The simplest fix here IMHO would be to include the device list in the event:
```js
navigator.mediaDevices.ondevicechange = async ({devices}) => {
  // examine devices and compare against oldDevices to detect changes once available
  oldDevices = devices;
}
```
Async problem solved and 100% backwards compatible (modeled on [trackEvent.streams](https://w3c.github.io/webrtc-pc/#dom-rtctrackevent-streams)).


-- 
GitHub Notification of comment by jan-ivar
Please view or discuss this issue at https://github.com/w3c/mediacapture-main/issues/972#issuecomment-1759908677 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 12 October 2023 15:58:21 UTC