Skip to content

Commit

Permalink
Add text about User Agent stream updates
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-be committed Nov 25, 2015
1 parent efeaff4 commit 03bcdcb
Showing 1 changed file with 67 additions and 6 deletions.
73 changes: 67 additions & 6 deletions getusermedia.html
Expand Up @@ -447,6 +447,72 @@ <h2>MediaStream</h2>
</li>
</ol>

<p>The User Agent may update a <code><a>MediaStream</a></code>'s <a href=
"#track-set">track set</a> in response to, for example, an external event.
This specification does not specify any such cases, but other specifications
using the MediaStream API may. One such example is the WebRTC 1.0
[[WEBRTC10]] specification where the <a href="#track-set">track set</a>
of a <code><a>MediaStream</a></code>, received from another peer, can be
updated as a result of changes to the media session.</p>

<p>When the User Agent initiates adding a track to a <code>
<a>MediaStream</a></code>, the User Agent MUST queue a task that runs the
following steps:</p>

<ol>
<li>
<p>Let <var>track</var> be the
<code><a>MediaStreamTrack</a></code> in question and
<var>stream</var> the <code><a>MediaStream</a></code>
object to which <var>track</var> is to be added.</p>
</li>

<li>
<p><a href="#stream-add-track">Add</a> <var>track</var> to
<var>stream</var>.</p>
</li>

<li>
<p>If the operation in the previous step was aborted prematurely,
then abort these steps.</p>
</li>

<li>
<p>Fire a track event named <code><a href=
"#event-mediastream-addtrack">addtrack</a></code> with
<var>track</var> at <var>stream</var>.</p>
</li>
</ol>

<p>When the User Agent initiates removing a track from a <code>
<a>MediaStream</a></code>, the User Agent MUST queue a task that runs the
following steps:</p>

<ol>
<li>
<p>Let <var>track</var> be the
<code><a>MediaStreamTrack</a></code> in question and
<var>stream</var> the <code><a>MediaStream</a></code>
object to which <var>track</var> is to be added.</p>
</li>

<li>
<p><a href="#stream-remove-track">Remove</a> <var>track</var> from
<var>stream</var>.</p>
</li>

<li>
<p>If the operation in the previous step was aborted prematurely,
then abort these steps.</p>
</li>

<li>
<p>Fire a track event named <code><a href=
"#event-mediastream-removetrack">removetrack</a></code> with
<var>track</var> at <var>stream</var>.</p>
</li>
</ol>

<dl class="idl" title="[Exposed=Window] interface MediaStream : EventTarget">
<dt>Constructor()</dt>

Expand Down Expand Up @@ -1736,12 +1802,7 @@ <h3>MediaStreamTrackEvent</h3>

<p>The <code>addtrack</code> and <code>removetrack</code> events notify
the script that the <a href="#track-set">track set</a> of a
<code><a>MediaStream</a></code> has been updated by the User Agent. This
specification does not specify any such cases, but other specifications
using the MediaStream API may. One such example is the WebRTC 1.0
[[WEBRTC10]] specification where the <a href="#track-set">track set</a>
of a <code><a>MediaStream</a></code>, received from another peer, can be
updated as a result of changes to the media session.</p>
<code><a>MediaStream</a></code> has been updated by the User Agent.

<p><dfn data-lt="Fire a track event">Firing a track event named
<var>e</var></dfn> with a <code><a>MediaStreamTrack</a></code>
Expand Down

0 comments on commit 03bcdcb

Please sign in to comment.