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

Define "speaker-selection" powerful feature types and algorithms. #128

Merged
merged 3 commits into from
Feb 10, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 72 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ <h2>Attributes</h2>
output is being delivered, or the empty string if output is
delivered through the user-agent default device. If nonempty, this
ID should be equal to the {{MediaDeviceInfo/deviceId}}
attribute of one of the {{MediaDeviceInfo}} values returned from
attribute of one of the {{MediaDeviceInfo}} values returned from
{{MediaDevices/enumerateDevices()}}.</p>
<p>On getting, the
attribute MUST return the value of the {{HTMLMediaElement/[[SinkId]]}} slot.</p>
Expand Down Expand Up @@ -256,8 +256,8 @@ <h2>Methods</h2>
<li>
<p>Run the following steps in parallel:</p>
<ol>
<li><p>Let <var>descriptor</var> be a {{PermissionDescriptor}} named
{{PermissionName/"speaker-selection"}}.</p>
<li><p>Let <var>descriptor</var> be a {{PermissionDescriptor}} with its
[=powerful feature/name=] set to "speaker-selection"</p>
</li>
<li>
<p>If <var>descriptor</var>'s [=permission state=] is
Expand Down Expand Up @@ -432,6 +432,75 @@ <h3>Obtaining Consent</h3>
</li>
</ol>
</section>
<section>
<h3 id=permissions-integration>Permissions Integration</h3>
<p>The Audio Output Devices API is a [=powerful feature=] that is
identified by the [=powerful feature/name=] "speaker-selection".</p>
<p>It defines the following types and algorithms:</p>
<dl>
<dt>
[=powerful feature/permission descriptor type=]
</dt>
<dd>
<p>
A permission covers access to the device given in the associated
{{DevicePermissionDescriptor}} descriptor.
</p>
<p>
If the descriptor does not have a {{DevicePermissionDescriptor/deviceId}}, its
semantic is that it queries for access to all devices of that class. Thus, if a query
for the "speaker-selection" [=powerful feature=] with no
{{DevicePermissionDescriptor/deviceId}} returns {{PermissionState/"granted"}}, the
client knows that there will never be a permission prompt for an audio output device,
jan-ivar marked this conversation as resolved.
Show resolved Hide resolved
and if {{PermissionState/"denied"}} is returned, it knows that no getUserMedia request
jan-ivar marked this conversation as resolved.
Show resolved Hide resolved
for an audio output device will succeed.
</p>
<p>
If a permission state is present for access to some, but not all, audio output devices,
a query without the {{DevicePermissionDescriptor/deviceId}} will return
{{PermissionState/"prompt"}}.
jan-ivar marked this conversation as resolved.
Show resolved Hide resolved
</p>
<p>
Note that a "granted" permission is no guarantee that getUserMedia will succeed. It
jan-ivar marked this conversation as resolved.
Show resolved Hide resolved
only guarantees that the user will not be prompted for permission. There are many
other things that can cause getUserMedia to fail.
</p>
miketaylr marked this conversation as resolved.
Show resolved Hide resolved
</dd>
<dt>
[=powerful feature/extra permission data type=]
</dt>
<dd>
A list of {{MediaDeviceInfo/deviceId}} values for the devices the user has made a
non-default decision on access to.
</dd>
<dt>
[=powerful feature/permission query algorithm=]
</dt>
<dd>
The permission query algorithm runs the following steps:
<ol class="algorithm">
<li>If |permissionDesc|.deviceId exists in the [=powerful feature/extra permission
data=], set <code>|status|.state</code> to |permissionDesc|'s <a>permission state</a>
and terminate these steps.
</li>
<li>Let <var>global</var> be a copy of |permissionDesc| with the
{{DevicePermissionDescriptor/deviceId}} member removed.
</li>
<li>Set <code>|status|.state</code> to <var>global</var>'s <a>permission state</a>.
</li>
</ol>
</dd>
<dt>
[=powerful feature/permission revocation algorithm=]
</dt>
<dd>
This is the result of calling the [=device permission revocation algorithm=] passing
{{PermissionDescriptor/name}} and {{DevicePermissionDescriptor/deviceId}} as arguments.
If the descriptor does not have a {{DevicePermissionDescriptor/deviceId}}, then
<code>undefined</code> is passed in place of {{DevicePermissionDescriptor/deviceId}}.
</dd>
</dl>
</section>
<section>
<h3 id=permissions-policy-integration>Permissions Policy Integration</h3>
<p>This specification defines one
Expand Down