w3c / mediacapture-output

API to manage the rendering of audio on any audio output device
https://w3c.github.io/mediacapture-output/
Other
26 stars 25 forks source link

It is unclear why https://w3c.github.io/mediacapture-output/#dom-htmlmediaelement-setsinkid 5.5 needs to queue a task #77

Closed smaug---- closed 5 years ago

smaug---- commented 6 years ago

https://w3c.github.io/mediacapture-output/#dom-htmlmediaelement-setsinkid 5.5 queues a task to set [[SinkId]] . [[SinkId]] is just a slot with initial value null. 5.3. has already changed element's underlying output device.

So, there is time between 5.3 and 5.5 when element's [[SinkId]] doesn't tell what the output device actually is.

guidou commented 5 years ago

That is correct, and it is written that way for practical reasons. "Switching the underlying audio output device" is typically a task that cannot be performed synchronously (i.e., typically you have to go to another thread or process to switch the device, and then get an asynchronous notification about the change being completed, which must run on another task).

guidou commented 5 years ago

Please reopen if you think this requires more discussion.