Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web pages might want to easily set a speaker setup previously used #99

Closed
youennf opened this issue Aug 3, 2020 · 1 comment · Fixed by #104
Closed

Web pages might want to easily set a speaker setup previously used #99

youennf opened this issue Aug 3, 2020 · 1 comment · Fixed by #104

Comments

@youennf
Copy link
Contributor

youennf commented Aug 3, 2020

A web site might allow a user to select speakers on first visit.
On a second visit, it would be convenient for the user to be able to easily select the exact same speaker configuration.
We could envision the user agent to do this or let the web page handle it.

@youennf
Copy link
Contributor Author

youennf commented Aug 3, 2020

Here are a few scenarios/ideas to start the discussion.

The first scenario is that the speaker to be used is the one related to the microphone disclosed by getUserMedia.
In that case, the specs seem fine as is: on every visit, the web page will start with getUserMedia and will then select the speaker exposed after getUserMedia.

The second scenario is the more general case where microphone is not in use.

If the device info(s) being used were statically exposed (#93), they will most probably be exposed again so setSinkId can be used directly.

If device info(s) were exposed to the web page by selectAudioOutput and used to set the whole page audio output (#87), the user agent may decide to set it back on next visit, based on some heuristics. This is easier done on a page scope than an individual media element scope.

In the more complex case where selectAudioOutput is used on individual elements or called several times to use multiple speakers, a possibility is for selectAudioOutput to take an additional ‘deviceId’ parameter. If the ‘deviceId’ matches an existing device, the user agent may decide to not prompt the user (let’s say user granted persistent access) and resolve the promise with the corresponding MediaDeviceInfo. This deviceId can then be used by setSinkID. If the ‘deviceId’ does not match any available speaker, it should be ignored and selectAudioOutput would continue with a prompt. This hopefully should prevent pages to passively monitor speakers. The potential downside here is that selectAudioOutput might prompt in some cases but not others.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants