@@ -611,7 +611,7 @@ <h4>Operation</h4>
611
611
612
612
< p > Add the candidate to < var > connection</ var > 's
613
613
< 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
615
615
candidate. Let < var > newCandidate</ var > be that object.</ p >
616
616
</ li >
617
617
@@ -789,13 +789,13 @@ <h3>Interface Definition</h3>
789
789
</ dd >
790
790
791
791
< dt > Promise<void> setLocalDescription (
792
- RTCSessionDescription description)</ dt >
792
+ RTCSessionDescriptionInit description)</ dt >
793
793
794
794
< dd >
795
795
< p > The < dfn id =
796
796
"dom-peerconnection-setlocaldescription "> < code > setLocalDescription()</ code > </ dfn >
797
797
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
799
799
description.</ p >
800
800
801
801
< p > This API changes the local media state. In order to successfully
@@ -814,7 +814,7 @@ <h3>Interface Definition</h3>
814
814
815
815
< p > The following list describes the < dfn id =
816
816
"set-description-model "> processing model</ dfn > for setting a new
817
- < code > < a > RTCSessionDescription </ a > </ code > .</ p >
817
+ < code > < a > RTCSessionDescriptionInit </ a > </ code > .</ p >
818
818
819
819
< ul >
820
820
< li >
@@ -846,7 +846,7 @@ <h3>Interface Definition</h3>
846
846
847
847
< li >
848
848
< 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 >
850
850
</ li >
851
851
852
852
< li >
@@ -857,7 +857,7 @@ <h3>Interface Definition</h3>
857
857
858
858
< li >
859
859
< 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
861
861
any reason, then user agent MUST queue a task runs the
862
862
following steps:</ p >
863
863
@@ -880,9 +880,9 @@ <h3>Interface Definition</h3>
880
880
< ul >
881
881
< li >
882
882
< p > The content of the
883
- < code > < a > RTCSessionDescription </ a > </ code > argument is
883
+ < code > < a > RTCSessionDescriptionInit </ a > </ code > argument is
884
884
invalid or the < code > < a href =
885
- "#widl-RTCSessionDescription -type "> type</ a > </ code > is
885
+ "#widl-RTCSessionDescriptionInit -type "> type</ a > </ code > is
886
886
wrong for the current < a href =
887
887
"#dom-peerconnection-signaling-state "> signaling
888
888
state</ a > of < var > connection</ var > .</ p >
@@ -892,7 +892,7 @@ <h3>Interface Definition</h3>
892
892
</ li >
893
893
894
894
< li >
895
- < p > The < code > < a > RTCSessionDescription </ a > </ code > is a
895
+ < p > The < code > < a > RTCSessionDescriptionInit </ a > </ code > is a
896
896
valid description but cannot be applied at the media
897
897
layer.</ p >
898
898
@@ -923,7 +923,7 @@ <h3>Interface Definition</h3>
923
923
</ li >
924
924
925
925
< li >
926
- < p > If the < code > < a > RTCSessionDescription </ a > </ code > argument is
926
+ < p > If the < code > < a > RTCSessionDescriptionInit </ a > </ code > argument is
927
927
applied successfully, then user agent MUST queue a task (< dfn
928
928
id ="setlocal-resolve "> setLocalDescription() resolve task</ dfn > )
929
929
that runs the following steps:</ p >
@@ -965,15 +965,15 @@ <h3>Interface Definition</h3>
965
965
966
966
<!-- A transition stable to haveLocalOffer --> < li > < p > If
967
967
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
969
969
type of "offer", and it has a version that is later than the
970
970
currentLocalDescription, then the pendingLocalDescription will be set to
971
971
the argument and the state will transition to
972
972
have-local-offer. </ p > </ li >
973
973
974
974
<!-- C transition haveRemoteOffer or haveLocalProvAnswer to
975
975
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
977
977
type of "answer", then this completes an offer answer
978
978
negotiation and currentLocalDescription is set to the argument,
979
979
currentRemoteDescription is set to the value of pendingRemoteDescription,
@@ -982,15 +982,15 @@ <h3>Interface Definition</h3>
982
982
983
983
<!-- D transition stable to haveRemoteOffer --> < li > < p > If
984
984
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
986
986
type of "offer", and it has a version that is later than the
987
987
currentRemoteDescription, then the pendingRemoteDescription will be set to
988
988
the argument and the state will transition to
989
989
have-remote-offer. </ p > </ li >
990
990
991
991
<!-- F transition haveRemoteOffer or haveLocalProvAnswer to
992
992
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
994
994
type of "answer", then this completes an offer answer
995
995
negotiation and currentRemoteDescription is set to the argument,
996
996
currentLocalDescription is set to the value of pendingLocalDescription,
@@ -999,21 +999,21 @@ <h3>Interface Definition</h3>
999
999
1000
1000
<!-- B transition rollback to haveLocalOffer to stable -->
1001
1001
< 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
1003
1003
type of "rollback", then this is a rollback and the
1004
1004
pendingLocalDescription is set to null and the state will
1005
1005
transition to stable. </ p > </ li >
1006
1006
1007
1007
<!-- E transition rollback to haveRemoteOffer to stable -->
1008
1008
< 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
1010
1010
type of "rollback", then this is a rollback and the
1011
1011
pendingRemoteDescription is set to null and the state will
1012
1012
transition to stable. </ p > </ li >
1013
1013
1014
1014
<!-- G transition haveRemoteOffer to haveLocalProvAnswer -->
1015
1015
< 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
1017
1017
type of "pranswer", then pendingLocalDescription will be set to the
1018
1018
argument and the state will transitions to
1019
1019
have-local-pranswer unless the state was stable,
@@ -1022,7 +1022,7 @@ <h3>Interface Definition</h3>
1022
1022
1023
1023
<!-- H transition haveRemoteOffer to haveLocalProvAnswer
1024
1024
--> < 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
1026
1026
type of "pranswer", then pendingRemoteDescription will be set to
1027
1027
the argument and the state will transitions to
1028
1028
have-remote-pranswer unless the state was stable,
@@ -1135,13 +1135,13 @@ <h3>Interface Definition</h3>
1135
1135
1136
1136
1137
1137
< dt > Promise<void> setRemoteDescription (
1138
- RTCSessionDescription description)</ dt >
1138
+ RTCSessionDescriptionInit description)</ dt >
1139
1139
1140
1140
< dd >
1141
1141
< p > The < dfn id =
1142
1142
"dom-peerconnection-setremotedescription "> < code > setRemoteDescription()</ code > </ dfn >
1143
1143
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
1145
1145
remote offer or answer. This API changes the local media state.</ p >
1146
1146
1147
1147
< p > When the method is invoked, the user agent MUST follow the < a
@@ -1150,7 +1150,7 @@ <h3>Interface Definition</h3>
1150
1150
In addition, a remote description is processed to determine and
1151
1151
verify the identity of the peer.</ p >
1152
1152
1153
- < p > If the < code > < a > RTCSessionDescription </ a > </ code > argument is
1153
+ < p > If the < code > < a > RTCSessionDescriptionInit </ a > </ code > argument is
1154
1154
applied successfully, the user agent MUST < a href =
1155
1155
"#dispatch-receiver "> dispatch a receiver</ a > for all new
1156
1156
media descriptions [[!RTCWEB-JSEP]] before queuing the < a href =
@@ -1633,7 +1633,7 @@ <h3>Legacy Interface Extensions</h3>
1633
1633
argument.</ p >
1634
1634
</ dd >
1635
1635
1636
- < dt > void setLocalDescription (RTCSessionDescription description,
1636
+ < dt > void setLocalDescription (RTCSessionDescriptionInit description,
1637
1637
VoidFunction successCallback, RTCPeerConnectionErrorCallback
1638
1638
failureCallback)</ dt >
1639
1639
@@ -1704,7 +1704,7 @@ <h3>Legacy Interface Extensions</h3>
1704
1704
argument.</ p >
1705
1705
</ dd >
1706
1706
1707
- < dt > void setRemoteDescription (RTCSessionDescription description,
1707
+ < dt > void setRemoteDescription (RTCSessionDescriptionInit description,
1708
1708
VoidFunction successCallback, RTCPeerConnectionErrorCallback
1709
1709
failureCallback)</ dt >
1710
1710
@@ -2125,7 +2125,7 @@ <h4>RTCSdpError</h4>
2125
2125
< dl class ="idl " title ="interface RTCSdpError : DOMError ">
2126
2126
< dt > readonly attribute long sdpLineNumber</ dt >
2127
2127
2128
- < dd > The line number of an < code > < a > RTCSessionDescription </ a > </ code >
2128
+ < dd > The line number of an < code > < a > RTCSessionDescriptionInit </ a > </ code >
2129
2129
at which the error was encountered.</ dd >
2130
2130
</ dl >
2131
2131
@@ -2137,13 +2137,13 @@ <h4>RTCSdpError</h4>
2137
2137
2138
2138
< ul >
2139
2139
< li > InvalidSessionDescriptionError: The provided
2140
- RTCSessionDescription contained invalid SDP, or the type was wrong
2140
+ RTCSessionDescriptionInit contained invalid SDP, or the type was wrong
2141
2141
for the current state of the RTCPeerConnection. User agents SHOULD
2142
2142
provide as much additional information in the error message as
2143
2143
possible, including the sdpLineNumber, if appropriate.</ li >
2144
2144
2145
2145
< li > IncompatibleSessionDescriptionError: The provided
2146
- RTCSessionDescription contained SDP that could not be correctly
2146
+ RTCSessionDescriptionInit contained SDP that could not be correctly
2147
2147
applied to the RTCPeerConnection due to its current state. User
2148
2148
agents SHOULD provide as much additional information in the error
2149
2149
message as possible, including the sdpLineNumber, if
@@ -2168,6 +2168,7 @@ <h3>Session Description Model</h3>
2168
2168
< h4 > RTCSdpType</ h4 >
2169
2169
2170
2170
< p > The RTCSdpType enum describes the type of an
2171
+ < code > < a > RTCSessionDescriptionInit</ a > </ code > or
2171
2172
< code > < a > RTCSessionDescription</ a > </ code > instance.</ p >
2172
2173
2173
2174
< dl class ="idl " title ="enum RTCSdpType ">
@@ -2215,6 +2216,11 @@ <h4>RTCSdpType</h4>
2215
2216
< section >
2216
2217
< h4 > RTCSessionDescription Class</ h4 >
2217
2218
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
+
2218
2224
< dl class ="idl " data-merge ="RTCSessionDescriptionInit " title =
2219
2225
"interface RTCSessionDescription ">
2220
2226
< dt > Constructor (RTCSessionDescriptionInit descriptionInitDict)</ dt >
@@ -2223,9 +2229,9 @@ <h4>RTCSessionDescription Class</h4>
2223
2229
"dom-sessiondescription "> < code > RTCSessionDescription()</ code > </ dfn >
2224
2230
constructor takes a dictionary argument,
2225
2231
< 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 >
2229
2235
2230
2236
< dt > attribute RTCSdpType type</ dt >
2231
2237
@@ -2314,47 +2320,31 @@ <h3>Interfaces for Connectivity Establishment</h3>
2314
2320
< section >
2315
2321
< h4 > RTCIceCandidate Type</ h4 >
2316
2322
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 >
2331
2326
2332
- < dt > attribute DOMString candidate</ dt >
2327
+ < dl class ="idl " title ="[Constructor(RTCIceCandidate copy)] dictionary RTCIceCandidate ">
2328
+ < dt > required DOMString candidate</ dt >
2333
2329
2334
2330
< dd > This carries the < code > candidate-attribute</ code > as defined in
2335
2331
section 15.1 of [[!ICE]].</ dd >
2336
2332
2337
- < dt > attribute DOMString? sdpMid</ dt >
2333
+ < dt > DOMString sdpMid</ dt >
2338
2334
2339
2335
< dd > If present, this contains the identifier of the "media stream
2340
2336
identification" as defined in [[!RFC3388]] for the media section this
2341
2337
candidate is associated with.</ dd >
2342
2338
2343
- < dt > attribute unsigned short? sdpMLineIndex</ dt >
2339
+ < dt > unsigned short sdpMLineIndex</ dt >
2344
2340
2345
2341
< dd > This indicates the index (starting at zero) of the m-line in the
2346
2342
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 >
2357
2343
</ 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 >
2358
2348
</ section >
2359
2349
2360
2350
< section >
@@ -6291,7 +6281,7 @@ <h3>Simple Peer-to-peer Example</h3>
6291
6281
})
6292
6282
.then(function () {
6293
6283
// send the offer to the other peer
6294
- signalingChannel.send(JSON.stringify({ "sdp ": pc.localDescription }));
6284
+ signalingChannel.send(JSON.stringify({ "desc ": pc.localDescription }));
6295
6285
})
6296
6286
.catch(logError);
6297
6287
};
@@ -6317,8 +6307,8 @@ <h3>Simple Peer-to-peer Example</h3>
6317
6307
start();
6318
6308
6319
6309
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 ;
6322
6312
6323
6313
// if we get an offer, we need to reply with an answer
6324
6314
if (desc.type == "offer") {
@@ -6329,13 +6319,13 @@ <h3>Simple Peer-to-peer Example</h3>
6329
6319
return pc.setLocalDescription(answer);
6330
6320
})
6331
6321
.then(function () {
6332
- signalingChannel.send(JSON.stringify({ "sdp ": pc.localDescription }));
6322
+ signalingChannel.send(JSON.stringify({ "desc ": pc.localDescription }));
6333
6323
})
6334
6324
.catch(logError);
6335
6325
} else
6336
6326
pc.setRemoteDescription(desc).catch(logError);
6337
6327
} else
6338
- pc.addIceCandidate(new RTCIceCandidate( message.candidate) ).catch(logError);
6328
+ pc.addIceCandidate(message.candidate).catch(logError);
6339
6329
};
6340
6330
6341
6331
function logError(error) {
@@ -6392,7 +6382,7 @@ <h3>Peer-to-peer Data Example</h3>
6392
6382
})
6393
6383
.then(function () {
6394
6384
// send the offer to the other peer
6395
- signalingChannel.send(JSON.stringify({ "sdp ": pc.localDescription }));
6385
+ signalingChannel.send(JSON.stringify({ "desc ": pc.localDescription }));
6396
6386
})
6397
6387
.catch(logError);
6398
6388
};
@@ -6415,8 +6405,8 @@ <h3>Peer-to-peer Data Example</h3>
6415
6405
start(false);
6416
6406
6417
6407
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 ;
6420
6410
6421
6411
// if we get an offer, we need to reply with an answer
6422
6412
if (desc.type == "offer") {
@@ -6427,13 +6417,13 @@ <h3>Peer-to-peer Data Example</h3>
6427
6417
return pc.setLocalDescription(answer);
6428
6418
})
6429
6419
.then(function () {
6430
- signalingChannel.send(JSON.stringify({ "sdp ": pc.localDescription }));
6420
+ signalingChannel.send(JSON.stringify({ "desc ": pc.localDescription }));
6431
6421
})
6432
6422
.catch(logError);
6433
6423
} else
6434
6424
pc.setRemoteDescription(desc).catch(logError);
6435
6425
} else
6436
- pc.addIceCandidate(new RTCIceCandidate( message.candidate) ).catch(logError);
6426
+ pc.addIceCandidate(message.candidate).catch(logError);
6437
6427
};
6438
6428
6439
6429
function setupChat() {
0 commit comments