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

Remove DevicePermissionDescriptor deviceId. #968

Merged
merged 6 commits into from
Aug 17, 2023
Merged
Changes from all commits
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: 15 additions & 60 deletions getusermedia.html
Original file line number Diff line number Diff line change
Expand Up @@ -881,25 +881,14 @@ <h4>Life-cycle</h4>
</ol>
<p>If the end of the track was reached due to a user request, the event
source for this event is the user interaction event source.</p>
<p>To invoke the <dfn class="abstract-op">device permission revocation algorithm</dfn> with <var>permissionName</var> and
{{DevicePermissionDescriptor/deviceId}} <var>deviceId</var>, run the
following steps:</p>
<p>To invoke the <dfn class="abstract-op">device permission revocation algorithm</dfn> with <var>permissionName</var>,
run the following steps:</p>
<ol class="algorithm">
<li>
<p>Let <var>tracks</var> be the set of all currently
{{MediaStreamTrackState/"live"}} <code>MediaStreamTrack</code>s
that fit the following criteria:</p>
<ul>
<li>
If <var>deviceId</var> is not <code>undefined</code>, tracks
whose associated <a>deviceId</a> matches <var>deviceId</var>
</li>
<li>
If <var>deviceId</var> is <code>undefined</code>, tracks whose
permission associated with this kind of track <a>"camera"</a>, <a>"microphone"</a>
matches <var>permissionName</var>
</li>
</ul>
whose permission associated with this kind of track (<a>"camera"</a> or <a>"microphone"</a>)
matches <var>permissionName</var>.</p>
</li>
<li>
<p>For each <var>track</var> in <var>tracks</var>,
Expand Down Expand Up @@ -3647,8 +3636,6 @@ <h2>Methods</h2>
use=] a {{PermissionDescriptor}} with its {{PermissionDescriptor/name}} member set
to the permission name associated with <var>kind</var>
(e.g. <a>"camera"</a> for <a>"video"</a>, <a>"microphone"</a> for <a>"audio"</a>),
and, optionally, consider its {{DevicePermissionDescriptor/deviceId}} member set to
any appropriate device's <var>deviceId</var>,
while considering all devices attached to a
live and <a>same-permission</a>
{{MediaStreamTrack}} in the current {{Document}}
Expand Down Expand Up @@ -5427,34 +5414,29 @@ <h1 id="permissions-integration">Permissions Integration</h1>
</dt>
<dd>
<pre class="idl">
dictionary DevicePermissionDescriptor : PermissionDescriptor {
DOMString deviceId;
};

dictionary CameraDevicePermissionDescriptor : DevicePermissionDescriptor {
dictionary CameraDevicePermissionDescriptor : PermissionDescriptor {
boolean panTiltZoom = false;
};
</pre>
<p>
A permission covers access to the device given in the associated descriptor.
A permission covers access to at least one device of a kind.
</p>
<p>
If the descriptor does not have a {{DevicePermissionDescriptor/deviceId}}, its
semantic is that it queries for access to any device of that kind. Thus, if a query
for the <a>"camera"</a> permission with no
{{DevicePermissionDescriptor/deviceId}} returns {{PermissionState/"granted"}}, the
The semantics of the descriptor is that it queries for access to any device of that kind.
Thus, if a query
for the <a>"camera"</a> permission returns {{PermissionState/"granted"}}, the
client knows that it will get access to one camera without a permission prompt, and if
{{PermissionState/"denied"}} is returned, it knows that no getUserMedia request for a
camera will succeed.
</p>
<p>
If a {{PermissionState/"granted"}} permission is present on some, but not all, devices of a kind, a query
without the {{DevicePermissionDescriptor/deviceId}} will return
If the User Agent considers permission given to some, but not all, devices of a kind, a query
will return
{{PermissionState/"granted"}}.
</p>
<p>
If a {{PermissionState/"denied"}} permission is present on all devices of a kind, a query
without the {{DevicePermissionDescriptor/deviceId}} will return
If the User Agent considers permission denied to all devices of a kind, a query
will return
{{PermissionState/"denied"}}.
</p>
<p>
Expand All @@ -5463,44 +5445,17 @@ <h1 id="permissions-integration">Permissions Integration</h1>
</p>
<p class="note">
A {{PermissionState/"granted"}} permission is no guarantee that getUserMedia will succeed. It
only indicates that the user will not be prompted for permission to the
{{DevicePermissionDescriptor/deviceId}} it specifies. There are many
only indicates that the user will not be prompted for permission. There are many
other things (such as constraints or the camera being in use) that can cause
getUserMedia to fail.
</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}}.
{{PermissionDescriptor/name}} as argument.
</dd>
</dl>
</section>
Expand Down
Loading