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

Move creation of MST after device selection. #833

Merged
merged 4 commits into from
Dec 9, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
39 changes: 24 additions & 15 deletions getusermedia.html
Original file line number Diff line number Diff line change
Expand Up @@ -3523,11 +3523,12 @@ <h2>Methods</h2>
<var>requestedMediaTypes</var>, run the following steps:</p>
<ol>
<li>
<p>For each possible <var>source</var> for
media of type <var>kind</var>,
[=create a MediaStreamTrack=] with <var>source</var>
and the value <code>false</code>.</p>
<p>Call this set of tracks the
<p>For each possible configuration of each possible
source device of media of type <var>kind</var>, conceive a
<dfn>candidate</dfn> as a placeholder for an eventual
{{MediaStreamTrack}} configured with a <a>settings
dictionary</a> comprised of its specific settings.</p>
jan-ivar marked this conversation as resolved.
Show resolved Hide resolved
<p>Call this set of candidates the
<var>candidateSet</var>.</p>
<p>If <var>candidateSet</var> is the empty set,
[= reject =] <var>p</var> with a new
Expand All @@ -3554,9 +3555,9 @@ <h2>Methods</h2>
these steps.</p></li>
<li>
<p>Run the <a>SelectSettings</a> algorithm on each
track in <var>candidateSet</var> with <var>CS</var>
candidate in <var>candidateSet</var> with <var>CS</var>
as the constraint set. If the algorithm returns
<code>undefined</code>, remove the track from
<code>undefined</code>, remove the candidate from
<var>candidateSet</var>. This eliminates devices
unable to satisfy the constraints, by verifying that
at least one settings dictionary exists that
Expand All @@ -3580,7 +3581,7 @@ <h2>Methods</h2>
candidate devices in <var>candidateSet</var> that are
not attached to a live {{MediaStreamTrack}}
in the current browsing context. Remove from
<var>candidateSet</var> any device for which the
<var>candidateSet</var> any candidate whose device's
permission state is {{PermissionState/"denied"}}.</p>
<p>If <var>candidateSet</var> is now empty,
indicating that all devices of this type are in state
Expand All @@ -3594,7 +3595,7 @@ <h2>Methods</h2>
Failure</em> below.</p>
</li>
<li>
<p>Add all tracks from <var>candidateSet</var> to
<p>Add all candidates from <var>candidateSet</var> to
<var>finalSet</var>.</p>
</li>
</ol>
Expand Down Expand Up @@ -3633,13 +3634,12 @@ <h2>Methods</h2>
MUST disclose whether permission will be granted only to
the device chosen, or to all devices of that
<var>kind</var>.</p>
<p>Let <var>track</var> be the provided media, which
MUST be precisely one track of type <var>kind</var> from
<var>finalSet</var>. The decision of which track to
<p>Let <var>finalCandidate</var> be the provided media, which
MUST be precisely one candidate of type <var>kind</var> from
<var>finalSet</var>. The decision of which candidate to
choose from the <var>finalSet</var> is completely up to
the User Agent and may be determined by asking the user.
Once selected, the source of the
{{MediaStreamTrack}} MUST NOT change.</p>
</p>
<p>The User Agent SHOULD use the value of the computed
<a>fitness distance</a> from the <a>SelectSettings</a>
algorithm as an input to the selection algorithm.
Expand Down Expand Up @@ -3677,14 +3677,23 @@ <h2>Methods</h2>
Otherwise, restart these sub steps with the updated <var>finalSet</var>.</p>
</li>
<li>
<p>Using the granted device's deviceId, <var>deviceId</var>, set
<p>Let <var>grantedDevice</var> be
<var>finalCandidate</var>'s source device.</p>
<li>
<p>Using <var>grantedDevice</var>'s deviceId, <var>deviceId</var>, set
{{MediaDevices/[[devicesLiveMap]]}}[<var>deviceId</var>] to
<code>true</code>, if it isn’t already <code>true</code>,
and set the
{{MediaDevices/[[devicesAccessibleMap]]}}[<var>deviceId</var>] to
<code>true</code>, if it isn’t already
<code>true</code>.</p>
</li>
<li>
<p>Let <var>track</var> be the result of
[=create a MediaStreamTrack|creating a MediaStreamTrack=]
with <var>grantedDevice</var> and the value <code>false</code>.
jan-ivar marked this conversation as resolved.
Show resolved Hide resolved
The source of the {{MediaStreamTrack}} MUST NOT change.</p>
</li>
<li>
<p>Add <var>track</var> to <var>stream</var>'s track set.</p>
</li>
Expand Down