Skip to content

Commit

Permalink
Add sender.setStreams() method to update stream associations.
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-ivar committed Apr 30, 2018
1 parent 918b8d1 commit c3680fa
Showing 1 changed file with 50 additions and 1 deletion.
51 changes: 50 additions & 1 deletion webrtc.html
Expand Up @@ -3701,7 +3701,9 @@ <h4>Updating the Negotiation-Needed flag</h4>
<p>If <var>transceiver</var>'s <a>[[\Direction]]</a> slot is
<code>"sendrecv"</code> or <code>"sendonly"</code>,
and the <a>associated</a> m= section in <var>description</var>
doesn't contain an "a=msid" line, return <code>true</code>.
either doesn't contain an "a=msid" line, or the MSIDs in
that line differ from <var>transceiver</var>'s sender's
<a>[[\AssociatedMediaStreamIds]]</a>, return <code>true</code>.
</p>
</li>
<li>
Expand Down Expand Up @@ -5540,6 +5542,7 @@ <h3><dfn>RTCRtpSender</dfn> Interface</h3>
Promise&lt;void&gt; setParameters (RTCRtpSendParameters parameters);
RTCRtpSendParameters getParameters ();
Promise&lt;void&gt; replaceTrack (MediaStreamTrack? withTrack);
void setStreams(MediaStream... streams);
Promise&lt;RTCStatsReport&gt; getStats();
};</pre>
<section>
Expand Down Expand Up @@ -5940,6 +5943,52 @@ <h2>Methods</h2>
</ol>
</div>
</dd>
<dt><code>setStreams</code></dt>
<dd>
<p>Sets the <code>MediaStream</code>s to be associated with this
sender's track.</p>
<p>When the <dfn data-idl><code>setStreams</code></dfn> method is invoked,
the user agent MUST run the following steps:</p>
<ol>
<li>
<p>Let <var>sender</var> be the
<code><a>RTCRtpSender</a></code> object on which this method
was invoked.</p>
</li>
<li>
<p>Let <var>connection</var> be the
<code><a>RTCPeerConnection</a></code> object on which this
method was invoked.</p>
</li>
<li>
<p>If <var>connection</var>'s <a>[[\IsClosed]]</a> slot is
<code>true</code>, <a>throw</a> an
<code>InvalidStateError</code>.</p>
</li>
<li>
<p>Let <var>streams</var> be a list of
<code><a>MediaStream</a></code> objects constructed from the
method's arguments, or an empty list if the method was called
without arguments.</p>
</li>
<li>
<p>Set <var>sender</var>'s
<a>[[\AssociatedMediaStreamIds]]</a> to an empty set.
</p>
</li>
<li>
<p>For each <var>stream</var> in <var>streams</var>, add
<var>stream.id</var> to
<a>[[\AssociatedMediaStreamIds]]</a> if it's not already
there.
</p>
</li>
<li>
<p><a data-lt="update the negotiation-needed flag">Update the
negotiation-needed flag</a> for <var>connection</var>.</p>
</li>
</ol>
</dd>
<dt><code>getStats</code></dt>
<dd>
<p>Gathers stats for this sender only and reports the result
Expand Down

0 comments on commit c3680fa

Please sign in to comment.