Skip to content

Commit

Permalink
Merge pull request #139 from jan-ivar/nodeviceid
Browse files Browse the repository at this point in the history
Remove deviceId from permission, and make granted = any
  • Loading branch information
alvestrand authored Aug 31, 2023
2 parents e450f85 + feb94c8 commit 142e1d4
Showing 1 changed file with 13 additions and 46 deletions.
59 changes: 13 additions & 46 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -455,58 +455,25 @@ <h3 id=permissions-integration>Permissions Integration</h3>
</dt>
<dd>
<p>
A permission covers access to the device given in the associated
{{DevicePermissionDescriptor}} descriptor.
A permission covers access to at least one non-default speaker output device.
</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 not be a permission prompt for any audio output device
known to it, if requested using the {{AudioOutputOptions/deviceId}} option to
{{MediaDevices/selectAudioOutput}},
and if {{PermissionState/"denied"}} is returned, it knows that no selectAudioOutput request
The semantics of the descriptor is that it queries for access to any non-default speaker
output device. Thus, if a query for the "speaker-selection" [=powerful feature=] returns
{{PermissionState/"granted"}}, the client knows that at least one of the
{{AudioOutputOptions/deviceId}}s previously shared with it can be passed to
{{MediaDevices/selectAudioOutput}} without incurring a permission prompt,
and if {{PermissionState/"denied"}} is returned, it knows that no {{MediaDevices/selectAudioOutput}} request
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"}}.
If the User Agent considers permission given to some, but not all, audio output devices,
a query will return {{PermissionState/"granted"}}.
</p>
<p>
If the User Agent considers permission denied to all audio output devices, a query
will return {{PermissionState/"denied"}}.
</p>
</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>
Expand Down

0 comments on commit 142e1d4

Please sign in to comment.