Skip to content

Commit

Permalink
Use 'create an RTCRtpSender/Receiver/Transceiver' definitions in addT…
Browse files Browse the repository at this point in the history
…ransceiver()
  • Loading branch information
adam-be committed Jun 22, 2016
1 parent 45a5e87 commit 913ea0d
Showing 1 changed file with 82 additions and 32 deletions.
114 changes: 82 additions & 32 deletions webrtc.html
Original file line number Diff line number Diff line change
Expand Up @@ -4076,35 +4076,73 @@ <h2>Methods</h2>
<code><a>RTCSessionDescription</a></code> may change it to a
non-null value, as defined in <span data-jsep=
"processing-a-local-desc processing-a-remote-desc">[[!JSEP]]</span>.</p>
<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 and the value is not a legal
<code><a>MediaStreamTrack</a></code> <code>kind</code>, throw a
<code>TypeError</code>.</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> (if necessary,
such as when <code>init.send == true</code>) will be selected by
the user agent and will not be related to any track. Future calls
to <code>sender.replaceTrack</code> with a track of a different
kind will fail. Future calls will not change the MSID associated
with the transceiver.</p>
<p>If <code>init.sendEncodings</code> is set, then subsequent
calls to <code>createOffer</code> will be configured to send with
multiple RTP encodings as defined in <span data-jsep=
"subsequent-offers">[[!JSEP]]</span>. When
<code>setRemoteDescription</code> is called with a corresponding
remote description that is able to receive multiple RTP encodings
as defined in [[!JSEP]], the <code><a>RTCRtpSender</a></code> may
send multiple RTP encodings and the parameters retrieved via the
transceiver&#8217;s <code>sender.getParameters()</code> will
reflect the encodings negotiated.</p>
<p>RID values passed into <code>init.sendEncodings</code> must be
composed only of case-sensitive alphanumeric characters (a-z,
A-Z, 0-9) up to a maximum of 16 characters.</p>
<p>When this method is invoked, the User Agent must run the
following steps:</p>
<ol>
<li>
<p>If the dictionary argument is present, and it has a
streams member, let <var>streams</var> be that list of <code>
<a>MediaStream</a></code> objects, or an empty list
otherwise.</p>
</li>
<li>
<p>If the dictionary argument is present, and it has a
sendEncodings member, let <var>sendEncodings</var> be that
list of <code><a>RTCRtpEncodingParameters</a></code> objects,
or an empty list otherwise.</p>
</li>
<li>
<p>If the first argument is a string, let it be
<var>kind</var> and run the following steps:</p>
<ol>
<li>
<p>If <var>kind</var> is not a legal <code>
<a>MediaStreamTrack</a></code> <code>kind</code>, throw a
<code>TypeError</code> and abort these, and all further
steps.</p>
</li>
<li>
<p>Let <var>track</var> be <code>null</code>.</p>
</li>
</ol>
</li>
<li>
<p>If the first argument is a <code>
<a>MediaStreamTrack</a></code>, let it be <var>track</var>
and let <var>kind</var> be <var>track.kind</var>.</p>
</li>
<li>
<p><a>Create an RTCRtpSender</a> with <var>track</var>,
<var>streams</var> and <var>sendEncodings</var> and let
<var>sender</var> be the result.</p>
<p>If <var>sendEncodings</var> is set, then subsequent
calls to <code>createOffer</code> will be configured to send
with multiple RTP encodings as defined in <span data-jsep=
"subsequent-offers">[[!JSEP]]</span>. When
<code>setRemoteDescription</code> is called with a
corresponding remote description that is able to receive
multiple RTP encodings as defined in [[!JSEP]], the <code>
<a>RTCRtpSender</a></code> may send multiple RTP encodings
and the parameters retrieved via the transceiver&#8217;s
<code>sender.getParameters()</code> will reflect the
encodings negotiated.</p> <p>RID values passed into
<code>init.sendEncodings</code> must be composed only of
case-sensitive alphanumeric characters (a-z, A-Z, 0-9) up to
a maximum of 16 characters.</p>
</li>
<li>
<p><a>Create an RTCRtpReceiver</a> with <var>kind</var> and
let <var>receiver</var> be the result.</p>
</li>
<li>
<p><a>Create an RTCRtpTransceiver</a> with <var>sender</var>
and <var>receiver</var> and let <var>transceiver</var> be the
result.</p>
</li>
<li>
<p>Return <var>transceiver</var>.</p>
</li>
</ol>
<table class="parameters">
<tbody>
<tr>
Expand Down Expand Up @@ -4413,9 +4451,10 @@ <h3>RTCRtpSender Interface</h3>
"sender-stopped">stopped</dfn>, which indicates that it will no longer
send any media.</p>
<p>To <dfn>create an RTCRtpSender</dfn> with a <code>
<a>MediaStreamTrack</a></code>, <var>track</var>, and a list of <code>
<a>MediaStream</a></code> objects, <var>streams</var>, run the following
steps:</p>
<a>MediaStreamTrack</a></code>, <var>track</var>, a list of <code>
<a>MediaStream</a></code> objects, <var>streams</var>, and optionally a
list of <code><a>RTCRtpEncodingParameters</a></code> objects,
<var>sendEncodings</var>, run the following steps:</p>
<ol>
<li>
<p>Let <var>sender</var> be a new <code><a>RTCRtpSender</a></code>
Expand All @@ -4435,6 +4474,17 @@ <h3>RTCRtpSender Interface</h3>
<p>Set <var>sender</var>'s [[<a>associated MediaStreams</a>]] slot to
<var>streams</var>.</p>
</li>
<li>
<p>Let <var>sender</var> have a [[<dfn>send encodings</dfn>]]
internal slot, representing a list of <code>
<a>RTCRtpEncodingParameters</a></code> objects, initialized to an
empty list.</p>
</li>
<li>
<p>If <var>sendEncodings</var> is given as input to this algorithm,
set the [[<a>send encodings</a>]] slot to
<var>sendEncodings</var>.</p>
</li>
<li>
<p>Return <var>sender</var>.</p>
</li>
Expand Down

0 comments on commit 913ea0d

Please sign in to comment.