Skip to content

Commit

Permalink
Specify behaviors of addTransceiver, addTrack, and removeTrack.
Browse files Browse the repository at this point in the history
  • Loading branch information
pthatcherg committed Oct 15, 2015
1 parent 8bb87d6 commit 67f7c41
Showing 1 changed file with 36 additions and 26 deletions.
62 changes: 36 additions & 26 deletions webrtc.html
Expand Up @@ -2478,12 +2478,25 @@ <h3>RTCPeerConnection Interface Extensions</h3>
<var>connection</var>'s <a href="#senders-set">set of senders</a>,
throw an <code>InvalidParameter</code> exception and abort these
steps.</p>
</li>

<li>
<p>If an <code>RTCRtpSender</code> exits in <var>connection</var>'s set of
senders that was created by a call to <code>setRemoteDescription</code>
with a remote offer and has always had a <code>.track</code>
of <code>null</code>, then set that sender's <code>.track</code>
to <var>track</var> and return the sender.</p>

<p>Doing so will cause future calls to <code>createAnswer</code> to mark
the m-line for the corresponding transceiver as <code>sendrecv</code>
or <code>sendonly</code>, as defined in [[!RTCWEB-JSEP]].
</li>

<li>
<p>Create a new <code>RTCRtpSender</code> for <var>track</var>, add it to
<var>connection</var>'s <a href="#senders-set">set of senders</a>,
and return it to the caller.</p>
<p>If no such sender exists, create a new <code>RTCRtpTransceiver</code>
with <code>.sender.track</code> set to <var>track</var>, add it to
<var>connection</var>'s set of transceivers, and
return <code>.sender</code> to the caller.</p>
</li>

<li>
Expand Down Expand Up @@ -2516,8 +2529,11 @@ <h3>RTCPeerConnection Interface Extensions</h3>
<dt>void removeTrack (RTCRtpSender sender)</dt>

<dd>
<p>Removes <var>sender</var>, and its associated <code>MediaStreamTrack</code>, from the
<code><a>RTCPeerConnection</a></code>.</p>
<p>Stops sending media from <var>sender</var>. The RTCRtpSender will still
appear in <code>getSenders</code>. Doing so will cause future calls
to <code>createOffer</code> to mark the m-line for the corresponding
transceiver as <code>recvonly</code> or <code>inactive</code>, as defined in
[[!RTCWEB-JSEP]].

<!-- onended -->
<p>When the other peer stops sending a track in this manner, an
Expand All @@ -2533,7 +2549,7 @@ <h3>RTCPeerConnection Interface Extensions</h3>
<p>Let <var>connection</var> be the
<code><a>RTCPeerConnection</a></code> object on which the
<code><a>RTCRtpSender</a></code>, <var>sender</var>, is to be
removed.</p>
stopped.</p>
</li>

<li>
Expand All @@ -2550,8 +2566,7 @@ <h3>RTCPeerConnection Interface Extensions</h3>
</li>

<li>
<p>Remove <var>sender</var> from <var>connection</var>'s
<a href="#senders-set">set of senders</a>.</p>
<p>Stop sending media from <var>sender</var>.</p>
</li>

<li>
Expand All @@ -2564,29 +2579,24 @@ <h3>RTCPeerConnection Interface Extensions</h3>
DOMString) trackOrKind, RTCRtpTransceiverInit init)</dt>

<dd>
<p>Create a new <code><a>RTCRtpTransceiver</a></code> and
add it to the collection of transceivers that will be
returned
<p>Create a new <code><a>RTCRtpTransceiver</a></code> and add it to the
collection of transceivers that will be returned
by <code><a href="#dom-peerconnection-getreceivers">getReceivers()</a></code>.</p>

<p>Adding a transceiver will cause future calls
to <code>createOffer</code> to add an m-line for the
corresponding transceiver, as defined in [[!RTCWEB-JSEP]].
<p>Adding a transceiver will cause future calls to <code>createOffer</code> to
add an m-line for the corresponding transceiver, as defined in
[[!RTCWEB-JSEP]].

<p>If a track is passed in, the value of
the <code>.sender.track</code> will be set to that track
and the MSID and media type generated
<p>If a track is passed in, the value of the <code>.sender.track</code> will
be set to that track and the MSID and media type generated
by <code>createOffer</code> will be that of the track.</p>

<p>If a kind is passed in, the value of
the <code>.sender.track</code> will be null and and media
type generated by <code>createOffer</code> will be that of
the kind. The MSID generted by <code>createOffer</code>
will be selected by the user agent and will not be related
to any track. Future calls
to <code>.sender.replaceTrack</code> must have a track of
the same kind and will not change the MSID associated with
the transceiver.</p>
<p>If a kind is passed in, the value of the <code>.sender.track</code> will be
null and and media type generated by <code>createOffer</code> will be that of
the kind. The MSID generated by <code>createOffer</code> will be selected by
the user agent and will not be related to any track. Future calls
to <code>.sender.replaceTrack</code> must have a track of the same kind and
will not change the MSID associated with the transceiver.</p>
</dd>

<dt>attribute EventHandler ontrack</dt>
Expand Down

0 comments on commit 67f7c41

Please sign in to comment.