Skip to content

Commit

Permalink
Merge pull request #890 from youennf/add-document-capturing-state
Browse files Browse the repository at this point in the history
Add an algorithm to determine whether a document is capturing or not.
  • Loading branch information
youennf authored Aug 18, 2022
2 parents a52140d + e86e63f commit e84ad3e
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions getusermedia.html
Original file line number Diff line number Diff line change
Expand Up @@ -3151,6 +3151,33 @@ <h2>Exposure decision algorithm for devices other than camera and microphone</h2
<p>By default, it returns <code>false</code>.</p>
<p>Other specifications can define the algorithm for specific device types.
</section>
<section>
<h2>Context capturing state</h2>
<p>To perform a <dfn data-export id="context-is-capturing">context is capturing</dfn> check
for <var>context</var>, run the following steps:</p>
<ol>
<li>
<p>For each <var>source</var> in <var>context</var>'s {{MediaDevices/[[mediaStreamTrackSources]]}},
run the following sub steps:</p>
<ol>
<li>
<p>If <var>source</var> is [=source/stopped=] or [=muted=], abort these steps.</p>
</li>
<li>
<p>Let <var>deviceId</var> be <var>source</var>'s device's deviceId.</p>
</li>
<li>
<p>If <var>context</var>'s {{MediaDevices/[[devicesLiveMap]]}}[<var>deviceId</var>] is
<code>true</code>, return <code>true</code>.</p>
</li>
</ol>
</li>
<li>
<p>Return <code>false</code>.</p>
</li>
</ol>
<p class="note">This algorithm covers all capture tracks, including microphone, camera and display.</p>
</section>
</section>
<section>
<h2>Device Info</h2>
Expand Down

0 comments on commit e84ad3e

Please sign in to comment.