Skip to content

Commit

Permalink
Add support for background blur and configuration change event
Browse files Browse the repository at this point in the history
  • Loading branch information
youennf committed May 19, 2022
1 parent 983c540 commit ffd3496
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -417,5 +417,62 @@ <h2>Transferable MediaStreamTrack</h2>
In a sense, between these steps, the data holder is attached to the underlying source as if it was a track.</p>
</div>
</section>
<section>
<h2>Exposing MediaStreamTrack source background blur support</h2>
<div>
<p>Some platforms or User Agents may provide built-in support for background blurring of video frames, in particular for camera video streams.
Web applications may either want to control or at least be aware that background blur is applied at the source level.
This may for instance allow the web application to update its UI or to not apply background blur on its own.
For that reason, we extend {{MediaStreamTrack}} with the following properties.
</p>
</div>
<div>
<p>The WebIDL changes are the following:
<pre class="idl">
partial dictionary MediaTrackSupportedConstraints {
boolean backgroundBlur = true;
};

partial dictionary MediaTrackConstraintSet {
ConstrainBoolean backgroundBlur;
};

partial dictionary MediaTrackSettings {
boolean backgroundBlur;
};

partial dictionary MediaTrackCapabilities {
sequence&lt;boolean&gt; backgroundBlur;
};</pre>
</div>
</section>
<section>
<h2>Exposing change of MediaStreamTrack configuration</h2>
<div>
<p>The configuration (capabilities, constraints or settings) of a {{MediaStreamTrack}} may be changed dynamically
outside the control of web applications. One example is when a user decides to switch on background blur through
the operating system. Web applications might want to know that the configuration
of a particular {{MediaStreamTrack}} has changed. For that purpose, a new event is defined below.
</p>
<pre class="idl">
partial interface MediaStreamTrack {
attribute EventHandler onconfigurationchange;
};</pre>
<p>
<p>When the [=User Agent=] detects <dfn data-export id="change-track-configuration">a change of configuration</dfn>
in a <var>track</var>'s underlying source, the [=User Agent=] MUST queue a task that runs the following steps:</p>
<ol>
<li>
<!-- FIXME: Export capabilities, constraints and settings so that we can use them here. -->
<p>Update <var>track</var>'s capabilities, constraints and settings
according <var>track</var>'s underlying source.</p>
</li>
<li>
<p>[=Fire an event=] named <var>configurationchanged</var> on <var>track</var>.</p>
</li>
</ol>
</p>
</div>
</section>
</body>
</html>

0 comments on commit ffd3496

Please sign in to comment.