Skip to content

Commit e09f10d

Browse files
committed
Merge pull request #302 from martinthomson/sd_ic_dict
Removing interface use for RTCSessionDescription and RTCIceCandidate
2 parents dd91f21 + beb10fe commit e09f10d

File tree

1 file changed

+56
-66
lines changed

1 file changed

+56
-66
lines changed

webrtc.html

+56-66
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ <h4>Operation</h4>
611611

612612
<p>Add the candidate to <var>connection</var>'s
613613
<code><a>localDescription</a></code> and create a
614-
<code><a>RTCIceCandidate</a></code> object to represent the
614+
<code><a>RTCIceCandidate</a></code> instance to represent the
615615
candidate. Let <var>newCandidate</var> be that object.</p>
616616
</li>
617617

@@ -789,13 +789,13 @@ <h3>Interface Definition</h3>
789789
</dd>
790790

791791
<dt>Promise&lt;void&gt; setLocalDescription (
792-
RTCSessionDescription description)</dt>
792+
RTCSessionDescriptionInit description)</dt>
793793

794794
<dd>
795795
<p>The <dfn id=
796796
"dom-peerconnection-setlocaldescription"><code>setLocalDescription()</code></dfn>
797797
method instructs the <code><a>RTCPeerConnection</a></code> to apply
798-
the supplied <code><a>RTCSessionDescription</a></code> as the local
798+
the supplied <code><a>RTCSessionDescriptionInit</a></code> as the local
799799
description.</p>
800800

801801
<p>This API changes the local media state. In order to successfully
@@ -814,7 +814,7 @@ <h3>Interface Definition</h3>
814814

815815
<p>The following list describes the <dfn id=
816816
"set-description-model">processing model</dfn> for setting a new
817-
<code><a>RTCSessionDescription</a></code>.</p>
817+
<code><a>RTCSessionDescriptionInit</a></code>.</p>
818818

819819
<ul>
820820
<li>
@@ -846,7 +846,7 @@ <h3>Interface Definition</h3>
846846

847847
<li>
848848
<p>The user agent MUST start the process to apply the
849-
<code><a>RTCSessionDescription</a></code> argument.</p>
849+
<code><a>RTCSessionDescriptionInit</a></code> argument.</p>
850850
</li>
851851

852852
<li>
@@ -857,7 +857,7 @@ <h3>Interface Definition</h3>
857857

858858
<li>
859859
<p>If the process to apply the
860-
<code><a>RTCSessionDescription</a></code> argument fails for
860+
<code><a>RTCSessionDescriptionInit</a></code> argument fails for
861861
any reason, then user agent MUST queue a task runs the
862862
following steps:</p>
863863

@@ -880,9 +880,9 @@ <h3>Interface Definition</h3>
880880
<ul>
881881
<li>
882882
<p>The content of the
883-
<code><a>RTCSessionDescription</a></code> argument is
883+
<code><a>RTCSessionDescriptionInit</a></code> argument is
884884
invalid or the <code><a href=
885-
"#widl-RTCSessionDescription-type">type</a></code> is
885+
"#widl-RTCSessionDescriptionInit-type">type</a></code> is
886886
wrong for the current <a href=
887887
"#dom-peerconnection-signaling-state">signaling
888888
state</a> of <var>connection</var>.</p>
@@ -892,7 +892,7 @@ <h3>Interface Definition</h3>
892892
</li>
893893

894894
<li>
895-
<p>The <code><a>RTCSessionDescription</a></code> is a
895+
<p>The <code><a>RTCSessionDescriptionInit</a></code> is a
896896
valid description but cannot be applied at the media
897897
layer.</p>
898898

@@ -923,7 +923,7 @@ <h3>Interface Definition</h3>
923923
</li>
924924

925925
<li>
926-
<p>If the <code><a>RTCSessionDescription</a></code> argument is
926+
<p>If the <code><a>RTCSessionDescriptionInit</a></code> argument is
927927
applied successfully, then user agent MUST queue a task (<dfn
928928
id="setlocal-resolve">setLocalDescription() resolve task</dfn>)
929929
that runs the following steps:</p>
@@ -965,15 +965,15 @@ <h3>Interface Definition</h3>
965965

966966
<!-- A transition stable to haveLocalOffer --> <li> <p>If
967967
the local description was set, and the
968-
<code><a>RTCSessionDescription</a></code> argument has a
968+
<code><a>RTCSessionDescriptionInit</a></code> argument has a
969969
type of "offer", and it has a version that is later than the
970970
currentLocalDescription, then the pendingLocalDescription will be set to
971971
the argument and the state will transition to
972972
have-local-offer. </p> </li>
973973

974974
<!-- C transition haveRemoteOffer or haveLocalProvAnswer to
975975
stable --> <li><p>If the local description was set, and the
976-
<code><a>RTCSessionDescription</a></code> argument has a
976+
<code><a>RTCSessionDescriptionInit</a></code> argument has a
977977
type of "answer", then this completes an offer answer
978978
negotiation and currentLocalDescription is set to the argument,
979979
currentRemoteDescription is set to the value of pendingRemoteDescription,
@@ -982,15 +982,15 @@ <h3>Interface Definition</h3>
982982

983983
<!-- D transition stable to haveRemoteOffer --> <li> <p>If
984984
the remote description was set, and the
985-
<code><a>RTCSessionDescription</a></code> argument has a
985+
<code><a>RTCSessionDescriptionInit</a></code> argument has a
986986
type of "offer", and it has a version that is later than the
987987
currentRemoteDescription, then the pendingRemoteDescription will be set to
988988
the argument and the state will transition to
989989
have-remote-offer. </p> </li>
990990

991991
<!-- F transition haveRemoteOffer or haveLocalProvAnswer to
992992
stable --> <li><p>If the remote description was set, and the
993-
<code><a>RTCSessionDescription</a></code> argument has a
993+
<code><a>RTCSessionDescriptionInit</a></code> argument has a
994994
type of "answer", then this completes an offer answer
995995
negotiation and currentRemoteDescription is set to the argument,
996996
currentLocalDescription is set to the value of pendingLocalDescription,
@@ -999,21 +999,21 @@ <h3>Interface Definition</h3>
999999

10001000
<!-- B transition rollback to haveLocalOffer to stable -->
10011001
<li> <p>If the local description was set, and the
1002-
<code><a>RTCSessionDescription</a></code> argument has a
1002+
<code><a>RTCSessionDescriptionInit</a></code> argument has a
10031003
type of "rollback", then this is a rollback and the
10041004
pendingLocalDescription is set to null and the state will
10051005
transition to stable. </p> </li>
10061006

10071007
<!-- E transition rollback to haveRemoteOffer to stable -->
10081008
<li> <p>If the remote description was set, and the
1009-
<code><a>RTCSessionDescription</a></code> argument has a
1009+
<code><a>RTCSessionDescriptionInit</a></code> argument has a
10101010
type of "rollback", then this is a rollback and the
10111011
pendingRemoteDescription is set to null and the state will
10121012
transition to stable. </p> </li>
10131013

10141014
<!-- G transition haveRemoteOffer to haveLocalProvAnswer -->
10151015
<li><p>If the local description was set, and the
1016-
<code><a>RTCSessionDescription</a></code> argument has a
1016+
<code><a>RTCSessionDescriptionInit</a></code> argument has a
10171017
type of "pranswer", then pendingLocalDescription will be set to the
10181018
argument and the state will transitions to
10191019
have-local-pranswer unless the state was stable,
@@ -1022,7 +1022,7 @@ <h3>Interface Definition</h3>
10221022

10231023
<!-- H transition haveRemoteOffer to haveLocalProvAnswer
10241024
--> <li><p>If the remote description was set, and the
1025-
<code><a>RTCSessionDescription</a></code> argument has a
1025+
<code><a>RTCSessionDescriptionInit</a></code> argument has a
10261026
type of "pranswer", then pendingRemoteDescription will be set to
10271027
the argument and the state will transitions to
10281028
have-remote-pranswer unless the state was stable,
@@ -1135,13 +1135,13 @@ <h3>Interface Definition</h3>
11351135

11361136

11371137
<dt>Promise&lt;void&gt; setRemoteDescription (
1138-
RTCSessionDescription description)</dt>
1138+
RTCSessionDescriptionInit description)</dt>
11391139

11401140
<dd>
11411141
<p>The <dfn id=
11421142
"dom-peerconnection-setremotedescription"><code>setRemoteDescription()</code></dfn>
11431143
method instructs the <code><a>RTCPeerConnection</a></code> to apply
1144-
the supplied <code><a>RTCSessionDescription</a></code> as the
1144+
the supplied <code><a>RTCSessionDescriptionInit</a></code> as the
11451145
remote offer or answer. This API changes the local media state.</p>
11461146

11471147
<p>When the method is invoked, the user agent MUST follow the <a
@@ -1150,7 +1150,7 @@ <h3>Interface Definition</h3>
11501150
In addition, a remote description is processed to determine and
11511151
verify the identity of the peer.</p>
11521152

1153-
<p>If the <code><a>RTCSessionDescription</a></code> argument is
1153+
<p>If the <code><a>RTCSessionDescriptionInit</a></code> argument is
11541154
applied successfully, the user agent MUST <a href=
11551155
"#dispatch-receiver">dispatch a receiver</a> for all new
11561156
media descriptions [[!RTCWEB-JSEP]] before queuing the <a href=
@@ -1633,7 +1633,7 @@ <h3>Legacy Interface Extensions</h3>
16331633
argument.</p>
16341634
</dd>
16351635

1636-
<dt>void setLocalDescription (RTCSessionDescription description,
1636+
<dt>void setLocalDescription (RTCSessionDescriptionInit description,
16371637
VoidFunction successCallback, RTCPeerConnectionErrorCallback
16381638
failureCallback)</dt>
16391639

@@ -1704,7 +1704,7 @@ <h3>Legacy Interface Extensions</h3>
17041704
argument.</p>
17051705
</dd>
17061706

1707-
<dt>void setRemoteDescription (RTCSessionDescription description,
1707+
<dt>void setRemoteDescription (RTCSessionDescriptionInit description,
17081708
VoidFunction successCallback, RTCPeerConnectionErrorCallback
17091709
failureCallback)</dt>
17101710

@@ -2125,7 +2125,7 @@ <h4>RTCSdpError</h4>
21252125
<dl class="idl" title="interface RTCSdpError : DOMError">
21262126
<dt>readonly attribute long sdpLineNumber</dt>
21272127

2128-
<dd>The line number of an <code><a>RTCSessionDescription</a></code>
2128+
<dd>The line number of an <code><a>RTCSessionDescriptionInit</a></code>
21292129
at which the error was encountered.</dd>
21302130
</dl>
21312131

@@ -2137,13 +2137,13 @@ <h4>RTCSdpError</h4>
21372137

21382138
<ul>
21392139
<li>InvalidSessionDescriptionError: The provided
2140-
RTCSessionDescription contained invalid SDP, or the type was wrong
2140+
RTCSessionDescriptionInit contained invalid SDP, or the type was wrong
21412141
for the current state of the RTCPeerConnection. User agents SHOULD
21422142
provide as much additional information in the error message as
21432143
possible, including the sdpLineNumber, if appropriate.</li>
21442144

21452145
<li>IncompatibleSessionDescriptionError: The provided
2146-
RTCSessionDescription contained SDP that could not be correctly
2146+
RTCSessionDescriptionInit contained SDP that could not be correctly
21472147
applied to the RTCPeerConnection due to its current state. User
21482148
agents SHOULD provide as much additional information in the error
21492149
message as possible, including the sdpLineNumber, if
@@ -2168,6 +2168,7 @@ <h3>Session Description Model</h3>
21682168
<h4>RTCSdpType</h4>
21692169

21702170
<p>The RTCSdpType enum describes the type of an
2171+
<code><a>RTCSessionDescriptionInit</a></code> or
21712172
<code><a>RTCSessionDescription</a></code> instance.</p>
21722173

21732174
<dl class="idl" title="enum RTCSdpType">
@@ -2215,6 +2216,11 @@ <h4>RTCSdpType</h4>
22152216
<section>
22162217
<h4>RTCSessionDescription Class</h4>
22172218

2219+
<p>The <code>RTCSessionDescription</code> class is used by
2220+
<code><a>RTCPeerConnection</a></code> to expose local and remote session
2221+
descriptions. Attributes on this interface are mutable for legacy
2222+
reasons.</p>
2223+
22182224
<dl class="idl" data-merge="RTCSessionDescriptionInit" title=
22192225
"interface RTCSessionDescription">
22202226
<dt>Constructor (RTCSessionDescriptionInit descriptionInitDict)</dt>
@@ -2223,9 +2229,9 @@ <h4>RTCSessionDescription Class</h4>
22232229
"dom-sessiondescription"><code>RTCSessionDescription()</code></dfn>
22242230
constructor takes a dictionary argument,
22252231
<var>descriptionInitDict</var>, whose content is used to initialize
2226-
the new <code><a>RTCSessionDescription</a></code> object. This class
2227-
is a future extensible carrier for the data contained in it and does
2228-
not perform any substantive processing.</dd>
2232+
the new <code><a>RTCSessionDescription</a></code> object. This
2233+
constructor is deprecated; it exists for legacy compatibility reasons
2234+
only.</dd>
22292235

22302236
<dt>attribute RTCSdpType type</dt>
22312237

@@ -2314,47 +2320,31 @@ <h3>Interfaces for Connectivity Establishment</h3>
23142320
<section>
23152321
<h4>RTCIceCandidate Type</h4>
23162322

2317-
<p>This class is a future extensible carrier for the data contained in
2318-
it and does not perform any substantive processing.</p>
2319-
2320-
<dl class="idl" data-merge="RTCIceCandidateInit" title=
2321-
"interface RTCIceCandidate">
2322-
<dt>Constructor (RTCIceCandidateInit candidateInitDict)</dt>
2323-
2324-
<dd>The <dfn id=
2325-
"dom-icecandidate"><code>RTCIceCandidate()</code></dfn> constructor
2326-
takes a dictionary argument, <var>candidateInitDict</var>,
2327-
whose content is used to initialize the new
2328-
<code><a>RTCIceCandidate</a></code> object. When constructed, values
2329-
for <var>candidate</var> and either <var>sdpMid</var>
2330-
or <var>sdpMLineIndex</var> MUST be provided.</dd>
2323+
<p>This describes an ICE candidate. Though not explicitly required,
2324+
values for <var>candidate</var> and either <var>sdpMid</var>
2325+
or <var>sdpMLineIndex</var> MUST be provided.</p>
23312326

2332-
<dt>attribute DOMString candidate</dt>
2327+
<dl class="idl" title="[Constructor(RTCIceCandidate copy)] dictionary RTCIceCandidate">
2328+
<dt>required DOMString candidate</dt>
23332329

23342330
<dd>This carries the <code>candidate-attribute</code> as defined in
23352331
section 15.1 of [[!ICE]].</dd>
23362332

2337-
<dt>attribute DOMString? sdpMid</dt>
2333+
<dt>DOMString sdpMid</dt>
23382334

23392335
<dd>If present, this contains the identifier of the "media stream
23402336
identification" as defined in [[!RFC3388]] for the media section this
23412337
candidate is associated with.</dd>
23422338

2343-
<dt>attribute unsigned short? sdpMLineIndex</dt>
2339+
<dt>unsigned short sdpMLineIndex</dt>
23442340

23452341
<dd>This indicates the index (starting at zero) of the m-line in the
23462342
SDP this candidate is associated with.</dd>
2347-
2348-
<dt>serializer = { attribute}</dt>
2349-
</dl>
2350-
2351-
<dl class="idl" title="dictionary RTCIceCandidateInit">
2352-
<dt>required DOMString candidate</dt>
2353-
2354-
<dt>DOMString sdpMid</dt>
2355-
2356-
<dt>unsigned short sdpMLineIndex</dt>
23572343
</dl>
2344+
<div class="note">
2345+
<p>The constructor on <code><a>RTCIceCandidate</a></code> exists
2346+
for legacy compatibility reasons only.</p>
2347+
</div>
23582348
</section>
23592349

23602350
<section>
@@ -6291,7 +6281,7 @@ <h3>Simple Peer-to-peer Example</h3>
62916281
})
62926282
.then(function () {
62936283
// send the offer to the other peer
6294-
signalingChannel.send(JSON.stringify({ "sdp": pc.localDescription }));
6284+
signalingChannel.send(JSON.stringify({ "desc": pc.localDescription }));
62956285
})
62966286
.catch(logError);
62976287
};
@@ -6317,8 +6307,8 @@ <h3>Simple Peer-to-peer Example</h3>
63176307
start();
63186308

63196309
var message = JSON.parse(evt.data);
6320-
if (message.sdp) {
6321-
var desc = new RTCSessionDescription(message.sdp);
6310+
if (message.desc) {
6311+
var desc = message.desc;
63226312

63236313
// if we get an offer, we need to reply with an answer
63246314
if (desc.type == "offer") {
@@ -6329,13 +6319,13 @@ <h3>Simple Peer-to-peer Example</h3>
63296319
return pc.setLocalDescription(answer);
63306320
})
63316321
.then(function () {
6332-
signalingChannel.send(JSON.stringify({ "sdp": pc.localDescription }));
6322+
signalingChannel.send(JSON.stringify({ "desc": pc.localDescription }));
63336323
})
63346324
.catch(logError);
63356325
} else
63366326
pc.setRemoteDescription(desc).catch(logError);
63376327
} else
6338-
pc.addIceCandidate(new RTCIceCandidate(message.candidate)).catch(logError);
6328+
pc.addIceCandidate(message.candidate).catch(logError);
63396329
};
63406330

63416331
function logError(error) {
@@ -6392,7 +6382,7 @@ <h3>Peer-to-peer Data Example</h3>
63926382
})
63936383
.then(function () {
63946384
// send the offer to the other peer
6395-
signalingChannel.send(JSON.stringify({ "sdp": pc.localDescription }));
6385+
signalingChannel.send(JSON.stringify({ "desc": pc.localDescription }));
63966386
})
63976387
.catch(logError);
63986388
};
@@ -6415,8 +6405,8 @@ <h3>Peer-to-peer Data Example</h3>
64156405
start(false);
64166406

64176407
var message = JSON.parse(evt.data);
6418-
if (message.sdp) {
6419-
var desc = new RTCSessionDescription(message.sdp);
6408+
if (message.desc) {
6409+
var desc = message.desc;
64206410

64216411
// if we get an offer, we need to reply with an answer
64226412
if (desc.type == "offer") {
@@ -6427,13 +6417,13 @@ <h3>Peer-to-peer Data Example</h3>
64276417
return pc.setLocalDescription(answer);
64286418
})
64296419
.then(function () {
6430-
signalingChannel.send(JSON.stringify({ "sdp": pc.localDescription }));
6420+
signalingChannel.send(JSON.stringify({ "desc": pc.localDescription }));
64316421
})
64326422
.catch(logError);
64336423
} else
64346424
pc.setRemoteDescription(desc).catch(logError);
64356425
} else
6436-
pc.addIceCandidate(new RTCIceCandidate(message.candidate)).catch(logError);
6426+
pc.addIceCandidate(message.candidate).catch(logError);
64376427
};
64386428

64396429
function setupChat() {

0 commit comments

Comments
 (0)