WebAudio / web-audio-api

The Web Audio API v1.0, developed by the W3C Audio WG
https://webaudio.github.io/web-audio-api/
Other
1.05k stars 166 forks source link

AudioContextOptions sinkId should only be allowed in a secure context #2598

Open mjwilson-google opened 1 month ago

mjwilson-google commented 1 month ago

AudioContext.setSinkId is only allowed in secure contexts.

However, a sink ID may also be passed into the AudioContext contructor, and the constructor may be called from an insecure context.

We don't specify what happens if this occurs in an insecure context. I think it should probably throw a NotAllowedError.

We can specify this right below the "If sinkId is specified, [...]" section of the AudioContext constructor steps.