forked from w3c/webrtc-pc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webrtc.html
12238 lines (12143 loc) · 624 KB
/
webrtc.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<link href="webrtc.css" rel="stylesheet">
<title>WebRTC 1.0: Real-time Communication Between Browsers</title>
<script class="remove" src="respec-w3c-common.js" type="text/javascript">
// // keep this comment //
</script>
<script class="remove" src="webrtc.js" type="text/javascript">
// // keep
this comment //
</script>
</head>
<body>
<p class='copyright'>Initial Author of this Specification was Ian Hickson, Google Inc., with the following copyright statement:<br /> © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and Opera Software ASA. You are granted a license to use, reproduce and create derivative works of this document. All subsequent changes since 26 July 2011 done by the W3C WebRTC Working Group are under the following <a href='https://www.w3.org/Consortium/Legal/ipr-notice#Copyright'>Copyright</a>:<br />© 2011-2018 <a href='https://www.w3.org/'><abbr title='World Wide Web Consortium'>W3C</abbr></a><sup>®</sup> (<a href='https://www.csail.mit.edu/'><abbr title='Massachusetts Institute of Technology'>MIT</abbr></a>, <a href='https://www.ercim.eu/'><abbr title='European Research Consortium for Informatics and Mathematics'>ERCIM</abbr></a>, <a href='https://www.keio.ac.jp/'>Keio</a>, <a href='https://ev.buaa.edu.cn/'>Beihang</a>). <a href='https://www.w3.org/Consortium/Legal/copyright-documents'>Document use</a> rules apply. For the entire publication on the W3C site the <a href='https://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer'>liability</a> and <a href='https://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks'>trademark</a> rules apply.</p>
<section id="abstract">
<p>This document defines a set of ECMAScript APIs in WebIDL to allow media
to be sent to and received from another browser or device implementing the
appropriate set of real-time protocols. This specification is being
developed in conjunction with a protocol specification developed by the
IETF RTCWEB group and an API specification to get access to local media
devices.</p>
</section>
<section id="sotd">
<p>The API is based on preliminary work done in the WHATWG.</p>
<p>The specification is feature complete and is expected to be stable with no further substantive change. Since the <a href="https://www.w3.org/TR/2018/CR-webrtc-20180927/">previous Candidate Recommendation</a>, the following substantive changes have been brought to the specification:</p>
<ul>
<li>The following features were removed given lack of implementation adoption - some are expected to move to extension specifications or future revisions of this specification:<ul>
<li>OAuth as a credential method for ICE servers</li>
<li>Negotiated {{RTCRtcpMuxPolicy}} (previously marked at risk)</li>
<li>voiceActivityDetection</li>
<li>getDefaultIceServers()</li>
<li>{{RTCCertificate}}.getSupportedAlgorithms()</li>
<li>statsended event</li>
<li>{{RTCRtpEncodingParameters}}: ptime, maxFrameRate, codecPayloadType, dtx, degradationPreference</li>
<li>{{RTCRtpDecodingParameters}}: encodings</li>
<li>{{RTCDatachannel}}.priority</li>
</ul>
</li>
<li>The following features have been added:<ul>
<li>{{RTCPeerConnection/restartIce()}} method added to {{RTCPeerConnection}}</li>
<li>Introduced the concept of “perfect negotiation”, with an example to solve signaling races.</li>
<li>Implicit rollback in {{RTCPeerConnection/setRemoteDescription}} to solve races.</li>
<li>Implicit offer/answer creation in {{RTCPeerConnection/setLocalDescription}} to solve races.</li>
</ul></li>
<li>The following features have been updated:<ul>
<li>Use of internal slots in several API descriptions to clarify state machine updates</li>
<li>Clarification of state machine transitions for RTCPeerConnection state, ICE Connection state</li>
<li>Updates to reflect WebIDL changes (constructor, default value for dictionaries)</li>
<li>Restructuring of the {{RTCPeerConnection/setLocalDescription}} and {{RTCPeerConnection/setRemoteDescription}} algorithms</li>
<li>Clarify and align with implementations the use of simulcast</li>
<li>Align with latest changes in <a href="https://w3c.github.io/webrtc-stats/">WebRTC Statistics</a></li>
</ul></li>
</ul>
<p>Its <a href="https://github.com/web-platform-tests/wpt/tree/master/webrtc">associated test suite</a> will be used to build an <a href="https://wpt.fyi/webrtc">implementation report</a> of the API.</p>
<p>To go into Proposed Recommendation status, the group expects to demonstrate implementation of each feature in at least two deployed browsers, and at least one implementation of each optional feature. Mandatory feature with only one implementation may be marked as optional in a revised Candidate Recommendation where applicable.</p>
<p>The following features are marked as at risk:</p>
<ul>
<li>All attributes defined in {{RTCError}}: {{RTCError/errorDetail}}, {{RTCError/sdpLineNumber}}, {{RTCError/sctpCauseCode}}, {{RTCError/receivedAlert}} and {{RTCError/sentAlert}}.</li>
</ul>
</section>
<section class="informative" id="intro">
<h2>Introduction</h2>
<p>There are a number of facets to peer-to-peer communications and
video-conferencing in HTML covered by this specification:</p>
<ul>
<li>Connecting to remote peers using NAT-traversal technologies such as
ICE, STUN, and TURN.</li>
<li>Sending the locally-produced tracks to remote peers and receiving
tracks from remote peers.</li>
<li>Sending arbitrary data directly to remote peers.</li>
</ul>
<p>This document defines the APIs used for these features. This
specification is being developed in conjunction with a protocol
specification developed by the <a href=
"https://datatracker.ietf.org/wg/rtcweb/">IETF RTCWEB group</a> and an API
specification to get access to local media devices [[GETUSERMEDIA]]
developed by the WebRTC Working Group. An overview of the system can be found in
[[RTCWEB-OVERVIEW]] and [[RTCWEB-SECURITY]].</p>
</section>
<section id="conformance">
<p>This specification defines conformance criteria that apply to a single
product: the <dfn>user agent</dfn> that implements the interfaces that it
contains.</p>
<p>Conformance requirements phrased as algorithms or specific steps may be
implemented in any manner, so long as the end result is equivalent. (In
particular, the algorithms defined in this specification are intended to be
easy to follow, and not intended to be performant.)</p>
<p>Implementations that use ECMAScript to implement the APIs defined in
this specification MUST implement them in a manner consistent with the
ECMAScript Bindings defined in the Web IDL specification [[!WEBIDL]], as
this specification uses that specification and terminology.</p>
</section>
<section>
<h2>Terminology</h2>
<p>The {{EventHandler}}
interface, representing a callback used for event handlers, is defined in [[!HTML]].</p>
<p>The concepts [= queue a
task =] and [= networking
task source =] are defined in [[!HTML]].</p>
<p>The concept [= fire an event =] is defined in [[!DOM]].</p>
<p>The terms [= event =], [= event handlers =] and [= event
handler event types =] are defined in [[!HTML]].</p>
<p>{{Performance.timeOrigin}} and {{Performance.now()}} are defined in [[!hr-time]].</p>
<p>The terms [= serializable objects =], [=
serialization steps =], and [=
deserialization steps =] are defined in [[!HTML]].</p>
<p>The terms {{MediaStream}}, {{MediaStreamTrack}}, and
{{MediaStreamConstraints}} are defined in [[!GETUSERMEDIA]].
Note that {{MediaStream}} is extended in <a href="#mediastream-network-use"></a> in this document while {{MediaStreamTrack}}
is extended in <a href="#mediastreamtrack-network-use"></a>
in this document.</p>
<p>The term {{Blob}} is defined in [[!FILEAPI]].</p>
<p>The term <dfn>media description</dfn> is defined in [[!RFC4566]].</p>
<p>The term <dfn>media transport</dfn> is defined in [[!RFC7656]].</p>
<p>The term <dfn>generation</dfn> is defined in [[!TRICKLE-ICE]] Section 2.</p>
<p>The terms <dfn data-cite="!WEBRTC-STATS#dfn-stats-object">stats object</dfn> and <dfn data-cite="!WEBRTC-STATS#dfn-monitored-object">monitored object</dfn> are defined in [[!WEBRTC-STATS]].</p>
<p>When referring to exceptions, the terms [= exception/throw =] and
[= exception/create =] are
defined in [[!WEBIDL]].</p>
<p>The callback {{VoidFunction}} is defined in [[!WEBIDL]].</p>
<p>The term "throw" is used as specified in [[!INFRA]]: it terminates
the current processing steps.
</p>
<p>The terms <dfn data-lt="fulfill|fulfillment">fulfilled</dfn>, <dfn
data-lt="reject|rejection|rejecting">rejected</dfn>, <dfn data-lt=
"resolve|resolves">resolved</dfn>, <dfn>pending</dfn> and
<dfn>settled</dfn> used in the context of Promises are defined in
[[!ECMASCRIPT-6.0]].</p>
<p>The terms <dfn>bundle</dfn>, <dfn>bundle-only</dfn> and <dfn>bundle-policy</dfn>
are defined in [[!JSEP]].</p>
<p>The <dfn data-cite="WebCryptoAPI/#dfn-AlgorithmIdentifier">AlgorithmIdentifier</dfn> is defined in [[!WebCryptoAPI]].</p>
<p class="note">
The general principles for Javascript APIs apply, including the principle
of <a href="https://w3ctag.github.io/design-principles/#js-rtc">
run-to-completion</a> and no-data-races as defined in [[API-DESIGN-PRINCIPLES]].
That is, while a task is running, external events do
not influence what's visible to the Javascript application. For example,
the amount of data buffered on a data channel will increase due to
"send" calls while Javascript is executing, and the decrease due to
packets being sent will be visible after a task checkpoint.
<br>
It is the responsibility of the user agent to make sure the set of
values presented to the application is consistent - for instance that
getContributingSources() (which is synchronous) returns values for all
sources measured at the same time.
</p>
</section>
<section>
<h2>Peer-to-peer connections</h2>
<section>
<h3>Introduction</h3>
<p data-tests="RTCPeerConnection-remote-track-mute.https.html">An {{RTCPeerConnection}} instance allows an
application to establish peer-to-peer communications with another
{{RTCPeerConnection}} instance in another browser, or to
another endpoint implementing the required protocols. Communications are coordinated by the
exchange of control messages (called a signaling protocol) over a
signaling channel which is provided by unspecified means, but generally
by a script in the page via the server, e.g. using
<a data-cite="html">Web Sockets</a> or <code>XMLHttpRequest</code> [[?xhr]].</p>
</section>
<section>
<h3>Configuration</h3>
<section>
<h4><dfn>RTCConfiguration</dfn> Dictionary</h4>
<p>The {{RTCConfiguration}} defines a set of parameters to
configure how the peer-to-peer communication established via
{{RTCPeerConnection}} is established or
re-established.</p>
<div>
<pre class="idl"
>dictionary RTCConfiguration {
sequence<RTCIceServer> iceServers;
RTCIceTransportPolicy iceTransportPolicy;
RTCBundlePolicy bundlePolicy;
RTCRtcpMuxPolicy rtcpMuxPolicy;
sequence<RTCCertificate> certificates;
[EnforceRange] octet iceCandidatePoolSize = 0;
};</pre>
<section>
<h2>Dictionary {{RTCConfiguration}} Members</h2>
<dl data-link-for="RTCConfiguration" data-dfn-for=
"RTCConfiguration" class="dictionary-members">
<dt data-tests="RTCConfiguration-iceServers.html"><dfn data-idl>iceServers</dfn> of type <span class=
"idlMemberType">sequence<{{RTCIceServer}}></span></dt>
<dd>
<p>An array of objects describing servers available to be used
by ICE, such as STUN and TURN servers.</p>
</dd>
<dt data-tests="RTCConfiguration-iceTransportPolicy.html"><dfn data-idl>iceTransportPolicy</dfn> of type
<span class="idlMemberType">{{RTCIceTransportPolicy}}</span>.</dt>
<dd>
<p>Indicates which candidates the [= ICE Agent =] is allowed
to use.</p>
</dd>
<dt data-tests="RTCConfiguration-bundlePolicy.html,RTCPeerConnection-iceConnectionState.https.html"><dfn data-idl>bundlePolicy</dfn> of type <span class=
"idlMemberType">{{RTCBundlePolicy}}</span>.</dt>
<dd>
<p>Indicates which <a data-lt=RTCBundlePolicy>media-bundling policy</a> to use when
gathering ICE candidates.</p>
</dd>
<dt data-tests="RTCConfiguration-rtcpMuxPolicy.html"><dfn data-idl>rtcpMuxPolicy</dfn> of type <span class=
"idlMemberType">{{RTCRtcpMuxPolicy}}</span>.</dt>
<dd>
<p>Indicates which <a data-lt=RTCRtcpMuxPolicy>rtcp-mux policy</a> to use when gathering
ICE candidates.</p>
</dd>
<dt data-tests="RTCPeerConnection-constructor.html,RTCCertificate.html"><dfn data-idl>certificates</dfn> of type <span class=
"idlMemberType">sequence<{{RTCCertificate}}></span></dt>
<dd>
<p>A set of certificates that the
{{RTCPeerConnection}} uses to authenticate.</p>
<p>Valid values for this parameter are created through calls to
the {{RTCPeerConnection/generateCertificate()}}
function.</p>
<p>Although any given DTLS connection will use only one
certificate, this attribute allows the caller to provide
multiple certificates that support different algorithms. The
final certificate will be selected based on the DTLS handshake,
which establishes which certificates are allowed. The
{{RTCPeerConnection}} implementation selects which of
the certificates is used for a given connection; how
certificates are selected is outside the scope of this
specification.</p>
<p>If this value is absent, then a default set of certificates
is generated for each {{RTCPeerConnection}}
instance.</p>
<p>This option allows applications to establish key continuity.
An {{RTCCertificate}} can be persisted in
[[?INDEXEDDB]] and reused. Persistence and reuse also avoids the
cost of key generation.</p>
<p>The value for this configuration option cannot change after
its value is initially selected.</p>
</dd>
<dt data-tests="RTCPeerConnection-constructor.html,RTCConfiguration-iceCandidatePoolSize.html"><dfn data-idl>iceCandidatePoolSize</dfn> of type
<span class="idlMemberType">octet</span>, defaulting to
<code>0</code></dt>
<dd>
<p>Size of the prefetched ICE pool as defined in
<span data-jsep=
"ice-candidate-pool constructor">[[!JSEP]]</span>.</p>
</dd>
</dl>
</section>
</div>
</section>
<section>
<h4><dfn>RTCIceCredentialType</dfn> Enum</h4>
<div>
<pre class="idl"
>enum RTCIceCredentialType {
"password"
};</pre>
<table data-link-for="RTCIceCredentialType" data-dfn-for=
"RTCIceCredentialType" class="simple">
<thead>
<tr>
<th colspan="2">Enumeration description</th>
</tr>
</thead>
<tbody>
<tr>
<td data-tests="RTCConfiguration-iceServers.html"><dfn data-idl>password</dfn></td>
<td>The credential is a long-term authentication username and
password, as described in [[!RFC5389]], Section 10.2.
</td>
</tr>
</tbody>
</table>
</div>
</section>
<section>
<h4><dfn>RTCIceServer</dfn> Dictionary</h4>
<p>The {{RTCIceServer}} dictionary is used to describe the
STUN and TURN servers that can be used by the [= ICE Agent =] to
establish a connection with a peer.</p>
<div>
<pre class="idl"
>dictionary RTCIceServer {
required (DOMString or sequence<DOMString>) urls;
DOMString username;
DOMString credential;
RTCIceCredentialType credentialType = "password";
};</pre>
<section>
<h2>Dictionary {{RTCIceServer}} Members</h2>
<dl data-link-for="RTCIceServer" data-dfn-for="RTCIceServer" class=
"dictionary-members">
<dt data-tests="RTCConfiguration-iceServers.html"><dfn data-idl>urls</dfn> of type <span class=
"idlMemberType">(DOMString or
sequence<DOMString>)</span>, required</dt>
<dd>
<p>STUN or TURN URI(s) as defined in [[!RFC7064]] and
[[!RFC7065]] or other URI types.</p>
</dd>
<dt data-tests="RTCConfiguration-iceServers.html"><dfn data-idl>username</dfn> of type <span class=
"idlMemberType">DOMString</span></dt>
<dd>
<p>If this {{RTCIceServer}} object represents a
TURN server, and {{credentialType}} is
{{RTCIceCredentialType/"password"}}, then this attribute specifies the
username to use with that TURN server.</p>
</dd>
<dt data-tests="RTCConfiguration-iceServers.html"><dfn data-idl>credential</dfn> of type {{DOMString}}</dt>
<dd>
<p>If this {{RTCIceServer}} object represents a
TURN server, then this attribute specifies the credential to
use with that TURN server.</p>
<p>If {{credentialType}} is {{RTCIceCredentialType/"password"}},
{{credential}} represents a
long-term authentication password, as described in
[[!RFC5389]], Section 10.2.</p>
<p class="note">To support additional values of
{{credentialType}}, {{credential}} may evolve in
future as a union.</p>
</dd>
<dt data-tests="RTCConfiguration-iceServers.html"><dfn data-idl>credentialType</dfn> of type <span class=
"idlMemberType">{{RTCIceCredentialType}}</span>, defaulting to
{{RTCIceCredentialType/"password"}}</dt>
<dd>
<p>If this {{RTCIceServer}} object represents a
TURN server, then this attribute specifies how
<var>credential</var> should be used when that TURN server
requests authorization.</p>
</dd>
</dl>
</section>
</div>
<p>An example array of {{RTCIceServer}} objects is:</p>
<pre class="example highlight">
[
{urls: 'stun:stun1.example.net'},
{urls: ['turns:turn.example.org', 'turn:turn.example.net'],
username: 'user',
credential: 'myPassword',
credentialType: 'password'},
];
</pre>
</section>
<section data-tests="RTCConfiguration-iceTransportPolicy.html">
<h4><dfn>RTCIceTransportPolicy</dfn> Enum</h4>
<p>As described in <span data-jsep="constructor">[[!JSEP]]</span>, if the
{{RTCConfiguration/iceTransportPolicy}} member of
the {{RTCConfiguration}} is specified, it defines the
<span data-jsep="ice-candidate-policy">ICE candidate policy
[[!JSEP]]</span> the browser uses to surface the permitted candidates
to the application; only these candidates will be used for connectivity
checks.</p>
<div>
<pre class="idl"
>enum RTCIceTransportPolicy {
"relay",
"all"
};</pre>
<table data-link-for="RTCIceTransportPolicy" data-dfn-for=
"RTCIceTransportPolicy" class="simple">
<thead>
<tr>
<th colspan="2">Enumeration description (non-normative)</th>
</tr>
</thead>
<tbody>
<tr>
<td><dfn data-idl>relay</dfn></td>
<td>
<p>
The [= ICE Agent =] uses only media relay candidates
such as candidates passing through a TURN server.
</p>
<div class="note">
This can be used to prevent the remote endpoint from learning
the user's IP addresses, which may be desired in certain
use cases. For example, in a "call"-based application, the
application may want to prevent an unknown caller from
learning the callee's IP addresses until the callee has
consented in some way.
</div>
</td>
</tr>
<tr>
<td><dfn data-idl>all</dfn></td>
<td>
<p>
The [= ICE Agent =] can use any type of candidate when
this value is specified.
</p>
<div class="note">
The implementation can still use its own candidate
filtering policy in order to limit the IP addresses exposed
to the application, as noted in the description of
{{RTCIceCandidate}}.{{RTCIceCandidate/address}}.
</div>
</td>
</tr>
</tbody>
</table>
</div>
</section>
<section data-tests="RTCConfiguration-bundlePolicy.html">
<h4><dfn>RTCBundlePolicy</dfn> Enum</h4>
<p>As described in <span data-jsep="constructor">[[!JSEP]]</span>,
bundle policy affects which media tracks are negotiated if the remote
endpoint is not bundle-aware, and what ICE candidates are gathered. If
the remote endpoint is bundle-aware, all media tracks and data channels
are bundled onto the same transport.</p>
<div>
<pre id="target-bundle-policy" class="idl"
>enum RTCBundlePolicy {
"balanced",
"max-compat",
"max-bundle"
};</pre>
<table data-link-for="RTCBundlePolicy" data-dfn-for="RTCBundlePolicy"
class="simple">
<thead>
<tr>
<th colspan="2">Enumeration description (non-normative)</th>
</tr>
</thead>
<tbody>
<tr>
<td data-tests="RTCRtpSender-transport.https.html,RTCPeerConnection-iceConnectionState.https.html"><dfn data-idl>balanced</dfn></td>
<td>Gather ICE candidates for each media type in use (audio,
video, and data). If the remote endpoint is not bundle-aware,
negotiate only one audio and video track on separate
transports.</td>
</tr>
<tr>
<td data-tests="RTCRtpSender-transport.https.html,RTCPeerConnection-iceConnectionState.https.html"><dfn data-idl>max-compat</dfn></td>
<td>Gather ICE candidates for each track. If the remote
endpoint is not bundle-aware, negotiate all media tracks on
separate transports.</td>
</tr>
<tr>
<td data-tests="RTCRtpSender-transport.https.html,RTCPeerConnection-iceConnectionState.https.html"><dfn data-idl>max-bundle</dfn></td>
<td>Gather ICE candidates for only one track. If the remote
endpoint is not bundle-aware, negotiate only one media
track.</td>
</tr>
</tbody>
</table>
</div>
</section>
<section data-tests="RTCConfiguration-rtcpMuxPolicy.html">
<h4><dfn>RTCRtcpMuxPolicy</dfn> Enum</h4>
<p>As described in <span data-jsep="constructor">[[!JSEP]]</span>, the
{{RTCRtcpMuxPolicy}} affects what ICE candidates are gathered to support
non-multiplexed RTCP. The only value defined in this spec is
{{RTCRtcpMuxPolicy/"require"}}.</p>
<div>
<pre id="target-rtcp-mux-policy" class="idl"
>enum RTCRtcpMuxPolicy {
"require"
};</pre>
<table data-link-for="RTCRtcpMuxPolicy" data-dfn-for=
"RTCRtcpMuxPolicy" class="simple">
<thead>
<tr>
<th colspan="2">Enumeration description (non-normative)</th>
</tr>
</thead>
<tbody>
<tr>
<td><dfn data-idl>require</dfn></td>
<td>Gather ICE candidates only for RTP and multiplex RTCP on
the RTP candidates. If the remote endpoint is not capable of
rtcp-mux, session negotiation will fail.</td>
</tr>
</tbody>
</table>
</div>
</section>
<section>
<h4>Offer/Answer Options</h4>
<p>These dictionaries describe the options that can be used to control
the offer/answer creation process.</p>
<div>
<pre class="idl"
>dictionary RTCOfferAnswerOptions {};</pre>
<section>
<h2>Dictionary <dfn>RTCOfferAnswerOptions</dfn>
Members</h2>
<dl data-link-for="RTCOfferAnswerOptions" data-dfn-for=
"RTCOfferAnswerOptions" class="dictionary-members">
</dl>
</section>
</div>
<div>
<pre class="idl"
>dictionary RTCOfferOptions : RTCOfferAnswerOptions {
boolean iceRestart = false;
};</pre>
<section>
<h2>Dictionary <dfn>RTCOfferOptions</dfn> Members</h2>
<dl data-link-for="RTCOfferOptions" data-dfn-for="RTCOfferOptions"
class="dictionary-members">
<dt data-tests="RTCPeerConnection-restartIce.https.html"><dfn data-idl>iceRestart</dfn> of type <span class=
"idlMemberType">boolean</span>, defaulting to
<code>false</code></dt>
<dd>
<p>When the value of this dictionary member is <code>true</code>,
or the relevant {{RTCPeerConnection}} object's
<a>[[\LocalIceCredentialsToReplace]]</a> slot is not empty, then
the generated description will have ICE credentials that are
different from the current credentials (as visible in the
{{RTCPeerConnection/currentLocalDescription}} attribute's
SDP). Applying the generated description will restart ICE, as
described in section 9.1.1.1 of [[!ICE]].</p>
<p>When the value of this dictionary member is <code>false</code>,
and the relevant {{RTCPeerConnection}} object's
<a>[[\LocalIceCredentialsToReplace]]</a> slot is empty,
and the {{RTCPeerConnection/currentLocalDescription}} attribute has
valid ICE credentials, then the generated description will have the
same ICE credentials as the current value from the
{{RTCPeerConnection/currentLocalDescription}} attribute.</p>
<p class="note">Performing an ICE restart is recommended when
{{RTCPeerConnection/iceConnectionState}} transitions to
{{RTCIceConnectionState/"failed"}}.
An application may additionally choose to listen for the
{{RTCPeerConnection/iceConnectionState}} transition to
{{RTCIceConnectionState/"disconnected"}}
and then use other sources of information (such as using
{{RTCPeerConnection/getStats}} to measure if the number of bytes sent
or received over the next couple of seconds increases) to determine
whether an ICE restart is advisable.</p>
</dd>
</dl>
</section>
</div>
<div>
<p>The <dfn>RTCAnswerOptions</dfn> dictionary describe options specific to session description of type {{RTCSdpType/"answer"}} (none in this version of the specification).</p>
<pre class="idl"
>dictionary RTCAnswerOptions : RTCOfferAnswerOptions {};</pre>
</div>
</section>
</section>
<section>
<h3>State Definitions</h3>
<section>
<h4><dfn>RTCSignalingState</dfn> Enum</h4>
<div>
<pre class="idl"
>enum RTCSignalingState {
"stable",
"have-local-offer",
"have-remote-offer",
"have-local-pranswer",
"have-remote-pranswer",
"closed"
};</pre>
<table data-link-for="RTCSignalingState" data-dfn-for=
"RTCSignalingState" class="simple">
<thead>
<tr>
<th colspan="2">Enumeration description</th>
</tr>
</thead>
<tbody>
<tr>
<td data-tests="RTCPeerConnection-onsignalingstatechanged.https.html,RTCPeerConnection-setRemoteDescription.html"><dfn data-idl>stable</dfn></td>
<td>There is no offer/answer exchange in progress. This is
also the initial state, in which case the local and remote
descriptions are empty.</td>
</tr>
<tr>
<td data-tests="RTCPeerConnection-createOffer.html, RTCPeerConnection-setLocalDescription-offer.html,RTCPeerConnection-setLocalDescription.html,RTCPeerConnection-setRemoteDescription.html"><dfn data-idl>have-local-offer</dfn></td>
<td>A local description, of type {{RTCSdpType/"offer"}}, has been successfully
applied.</td>
</tr>
<tr>
<td data-tests="RTCPeerConnection-setLocalDescription-answer.html,RTCPeerConnection-setRemoteDescription-offer.html,RTCPeerConnection-setRemoteDescription-rollback.html,RTCPeerConnection-setRemoteDescription.html"><dfn data-idl>have-remote-offer</dfn></td>
<td>A remote description, of type {{RTCSdpType/"offer"}}, has been
successfully applied.</td>
</tr>
<tr>
<td data-tests="RTCPeerConnection-setLocalDescription-pranswer.html"><dfn data-idl>have-local-pranswer</dfn></td>
<td>A remote description of type {{RTCSdpType/"offer"}} has been successfully
applied and a local description of type {{RTCSdpType/"pranswer"}} has been
successfully applied.</td>
</tr>
<tr>
<td data-tests="RTCPeerConnection-setRemoteDescription-pranswer.html"><dfn data-idl>have-remote-pranswer</dfn></td>
<td>A local description of type {{RTCSdpType/"offer"}} has been successfully
applied and a remote description of type {{RTCSdpType/"pranswer"}} has been
successfully applied.</td>
</tr>
<tr>
<td data-tests="RTCPeerConnection-close.html"><dfn data-idl>closed</dfn></td>
<td>The {{RTCPeerConnection}} has been closed;
its <a>[[\IsClosed]]</a> slot is <code>true</code>.</td>
</tr>
</tbody>
</table>
</div>
<figure>
<img alt="signalling state transition diagram" src=
"images/peerstates.svg" width="600">
<figcaption>
Non-normative signalling state transitions diagram. Method calls abbreviated.
</figcaption>
</figure>
<p>An example set of transitions might be:</p>
<dl>
<dt>Caller transition:</dt>
<dd>
<ul>
<li>new RTCPeerConnection(): {{RTCSignalingState/"stable"}}</li>
<li>setLocalDescription(offer): {{RTCSignalingState/"have-local-offer"}}</li>
<li>setRemoteDescription(pranswer): {{RTCSignalingState/"have-remote-pranswer"}}</li>
<li>setRemoteDescription(answer): {{RTCSignalingState/"stable"}}</li>
</ul>
</dd>
<dt>Callee transition:</dt>
<dd>
<ul>
<li>new RTCPeerConnection(): {{RTCSignalingState/"stable"}}</li>
<li>setRemoteDescription(offer): {{RTCSignalingState/"have-remote-offer"}}</li>
<li>setLocalDescription(pranswer): {{RTCSignalingState/"have-local-pranswer"}}</li>
<li>setLocalDescription(answer): {{RTCSignalingState/"stable"}}</li>
</ul>
</dd>
</dl>
</section>
<section>
<h4><dfn>RTCIceGatheringState</dfn> Enum</h4>
<div>
<pre class="idl"
>enum RTCIceGatheringState {
"new",
"gathering",
"complete"
};</pre>
<table data-link-for="RTCIceGatheringState" data-dfn-for=
"RTCIceGatheringState" class="simple">
<thead>
<tr>
<th colspan="2">Enumeration description</th>
</tr>
</thead>
<tbody>
<tr>
<td data-tests="RTCPeerConnection-iceGatheringState.html"><dfn data-idl>new</dfn></td>
<td>Any of the {{RTCIceTransport}}s are in the
{{RTCIceGathererState/"new"}} gathering state and none of the transports are
in the {{RTCIceGathererState/"gathering"}} state, or there are no
transports.</td>
</tr>
<tr>
<td data-tests="RTCPeerConnection-iceGatheringState.html"><dfn data-idl>gathering</dfn></td>
<td>Any of the {{RTCIceTransport}}s are in the
{{RTCIceGathererState/"gathering"}} state.</td>
</tr>
<tr>
<td data-tests="RTCPeerConnection-iceGatheringState.html,protocol/candidate-exchange.https.html"><dfn data-idl>complete</dfn></td>
<td>At least one {{RTCIceTransport}} exists,
and all {{RTCIceTransport}}s are in the
{{RTCIceGathererState/"complete"}} gathering state.</td>
</tr>
</tbody>
</table>
</div>
</section>
<section>
<h4><dfn>RTCPeerConnectionState</dfn> Enum</h4>
<div>
<pre class="idl"
>enum RTCPeerConnectionState {
"closed",
"failed",
"disconnected",
"new",
"connecting",
"connected"
};</pre>
<table data-link-for="RTCPeerConnectionState" data-dfn-for=
"RTCPeerConnectionState" class="simple">
<thead>
<tr>
<th colspan="2">Enumeration description</th>
</tr>
</thead>
<tbody>
<tr>
<td data-tests="RTCPeerConnection-connectionState.https.html"><dfn data-idl>closed</dfn></td>
<td>
The {{RTCPeerConnection}} object's
<a>[[\IsClosed]]</a> slot is <code>true</code>.
</td>
</tr>
<tr>
<td data-tests="protocol/dtls-fingerprint-validation.html"><dfn data-idl>failed</dfn></td>
<td>The previous state doesn't apply and any
{{RTCIceTransport}}s are in the
{{RTCIceTransportState/"failed"}} state or any
{{RTCDtlsTransport}}s are in the
{{RTCDtlsTransportState/"failed"}} state.</td>
</tr>
<tr>
<td data-tests=""><dfn data-idl>disconnected</dfn></td>
<td>None of the previous states apply and any
{{RTCIceTransport}}s are in the
{{RTCIceTransportState/"disconnected"}} state.</td>
</tr>
<tr>
<td data-tests="RTCPeerConnection-connectionState.https.html"><dfn data-idl>new</dfn></td>
<td>None of the previous states apply and all
{{RTCIceTransport}}s are in the {{RTCIceTransportState/"new"}}
or {{RTCIceTransportState/"closed"}} state, and all
{{RTCDtlsTransport}}s are in the {{RTCDtlsTransportState/"new"}}
or {{RTCDtlsTransportState/"closed"}} state, or there are no
transports.</td>
</tr>
<tr>
<td data-tests="RTCPeerConnection-connectionState.https.html"><dfn data-idl>connecting</dfn></td>
<td>None of the previous states apply and all
{{RTCIceTransport}}s are in the {{RTCIceTransportState/"new"}}
or {{RTCIceTransportState/"checking"}} state, and all
{{RTCDtlsTransport}}s are in the
{{RTCDtlsTransportState/"new"}} or
{{RTCDtlsTransportState/"connecting"}} state.</td>
</tr>
<tr>
<td data-tests="RTCPeerConnection-connectionState.https.html"><dfn data-idl>connected</dfn></td>
<td>None of the previous states apply and all
{{RTCIceTransport}}s are in the
{{RTCIceTransportState/"connected"}},
{{RTCIceTransportState/"completed"}} or
{{RTCIceTransportState/"closed"}} state, and all
{{RTCDtlsTransport}}s are in the
{{RTCDtlsTransportState/"connected"}} or
{{RTCDtlsTransportState/"closed"}} state.</td>
</tr>
</tbody>
</table>
</div>
</section>
<section>
<h4><dfn>RTCIceConnectionState</dfn> Enum</h4>
<div>
<pre class="idl"
>enum RTCIceConnectionState {
"closed",
"failed",
"disconnected",
"new",
"checking",
"completed",
"connected"
};</pre>
<table data-link-for="RTCIceConnectionState" data-dfn-for=
"RTCIceConnectionState" class="simple">
<thead>
<tr>
<th colspan="2">Enumeration description</th>
</tr>
</thead>
<tbody>
<tr>
<td data-tests="RTCPeerConnection-iceConnectionState.https.html"><dfn data-idl>closed</dfn></td>
<td>
The {{RTCPeerConnection}} object's
<a>[[\IsClosed]]</a> slot is <code>true</code>.
</td>
</tr>
<tr>
<td data-tests="RTCPeerConnection-iceConnectionState-disconnected.https.html,protocol/ice-state.https.html"><dfn data-idl>failed</dfn></td>
<td>The previous state doesn't apply and any
{{RTCIceTransport}}s are in the
{{RTCIceTransportState/"failed"}} state.</td>
</tr>
<tr>
<td data-tests="RTCPeerConnection-iceConnectionState-disconnected.https.html,protocol/ice-state.https.html"><dfn data-idl>disconnected</dfn></td>
<td>None of the previous states apply and any
{{RTCIceTransport}}s are in the
{{RTCIceTransportState/"disconnected"}} state.</td>
</tr>
<tr>
<td data-tests="RTCPeerConnection-iceConnectionState.https.html,no-media-call.html"><dfn data-idl>new</dfn></td>
<td>None of the previous states apply and all
{{RTCIceTransport}}s are in the
{{RTCIceTransportState/"new"}} or {{RTCIceTransportState/"closed"}} state,
or there are no transports.</td>
</tr>
<tr>
<td data-tests="RTCPeerConnection-iceConnectionState.https.html,no-media-call.html"><dfn data-idl>checking</dfn></td>
<td>None of the previous states apply and any
{{RTCIceTransport}}s are in the
{{RTCIceTransportState/"new"}} or {{RTCIceTransportState/"checking"}} state.</td>
</tr>
<tr>
<td data-tests="RTCPeerConnection-iceConnectionState.https.html"><dfn data-idl>completed</dfn></td>
<td>None of the previous states apply and all
{{RTCIceTransport}}s are in the
{{RTCIceTransportState/"completed"}} or {{RTCIceTransportState/"closed"}} state.</td>
</tr>
<tr>
<td data-tests="RTCPeerConnection-iceConnectionState.https.html,protocol/ice-state.https.html,RTCIceConnectionState-candidate-pair.https.html"><dfn data-idl>connected</dfn></td>
<td>None of the previous states apply and all
{{RTCIceTransport}}s are in the
{{RTCIceTransportState/"connected"}}, {{RTCIceTransportState/"completed"}} or
{{RTCIceTransportState/"closed"}} state.</td>
</tr>
</tbody>
</table>
</div>
<p>Note that if an {{RTCIceTransport}} is discarded as
a result of signaling (e.g. RTCP mux or bundling), or created as a
result of signaling (e.g. adding a new [= media description =]), the
state may advance directly from one state to another.</p>
</section>
</section>
<section>
<h3>RTCPeerConnection Interface</h3>
<p>The [[!JSEP]] specification, as a whole, describes the details of how
the {{RTCPeerConnection}} operates. References to
specific subsections of [[!JSEP]] are provided as appropriate.</p>
<section>
<h4>Operation</h4>
<p>Calling <code>new {{RTCPeerConnection}}(<var>configuration</var>)
</code> creates an {{RTCPeerConnection}} object.</p>
<p><var>configuration</var>.{{RTCConfiguration/iceServers}} contains information
used to find and access the servers used by ICE. The application can
supply multiple servers of each type, and any TURN server MAY also be
used as a STUN server for the purposes of gathering server reflexive
candidates.</p>
<p>An {{RTCPeerConnection}} object has a <dfn>signaling
state</dfn>, a <dfn>connection state</dfn>, an <dfn>ICE gathering
state</dfn>, and an <dfn>ICE connection state</dfn>. These are
initialized when the object is created.</p>
<p data-link-for="RTCPeerConnection">The ICE protocol implementation of
an {{RTCPeerConnection}} is represented by an <dfn>ICE
agent</dfn> [[!ICE]]. Certain {{RTCPeerConnection}}
methods involve interactions with the [= ICE Agent =], namely
{{addIceCandidate}}, {{setConfiguration}},
{{setLocalDescription}},
{{setRemoteDescription}} and {{close}}.
These interactions are described in the relevant sections in this
document and in [[!JSEP]]. The [= ICE Agent =] also provides
indications to the user agent when the state of its internal
representation of an {{RTCIceTransport}} changes, as
described in <a href="#rtcicetransport"></a>.</p>
<p>The task source for the tasks listed in this section is the
[= networking task source =].</p>
<p class="note" data-link-for="RTCPeerConnection">The state of the SDP
negotiation is represented by
the [= signaling state =] and the internal
variables <a>[[\CurrentLocalDescription]]</a>,
<a>[[\CurrentRemoteDescription]]</a>, <a>[[\PendingLocalDescription]]</a>
and <a>[[\PendingRemoteDescription]]</a>. These are only set
inside the {{setLocalDescription}}
and {{setRemoteDescription}} operations, and
modified by the {{addIceCandidate}} operation and
the [= surface a candidate =] procedure. In each case, all
the modifications to all the five variables are completed
before the procedures fire any events or invoke any callbacks,
so the modifications are made visible at a single point in time.</p>
<section>
<h4>Constructor</h4>
<p>When the <dfn id=
"dom-peerconnection">RTCPeerConnection.constructor()</dfn>
is invoked, the user agent MUST run the following steps:</p>
<ol>
<li class="untestable">
<p>If any of the steps enumerated below fails for a reason not
specified here, [= exception/throw =] an {{UnknownError}}
with the {{DOMException/message}} attribute set to an appropriate description.
</p>
</li>
<li class="no-test-needed">
<p>Let <var>connection</var> be a newly created
{{RTCPeerConnection}} object.</p>
</li>
<li>
<p>Let <var>connection</var> have a <dfn>[[\DocumentOrigin]]</dfn>
internal slot, initialized to the <a data-cite="html">current settings object</a>'s <a data-cite="html#concept-settings-object-origin">
origin</a>.</p>
</li>
<li class="no-test-needed">Let <var>configuration</var> be the method's first argument.</li>
<li data-tests="RTCCertificate.html">
<p id="certificate-validation">If the {{RTCConfiguration/certificates}} value in
<var>configuration</var> is non-empty, run the following steps for
each <var>certificate</var> in certificates:
<ol>
<li>
<p>If the value of <var>certificate</var>.{{RTCCertificate/expires}}
is less than the current time, [= exception/throw =] an
{{InvalidAccessError}}.</p> </li>
<li>
<p>If <var>certificate</var>.<a>[[\Origin]]</a> is not <a data-cite="html">same
origin</a> with <var>connection</var>.<a>[[\DocumentOrigin]]</a>,
[= exception/throw =] an {{InvalidAccessError}}.</p>
</li>
<li>
<p>Store <var>certificate</var>.</p>
</li>
</ol>
</li>
<li>
<p>Else, generate one or more new {{RTCCertificate}} instances
with this {{RTCPeerConnection}} instance and store them. This MAY happen
asynchronously and the value of {{RTCConfiguration/certificates}} remains
<code>undefined</code> for the subsequent steps. As noted in Section 4.3.2.3 of
[[RTCWEB-SECURITY]], WebRTC utilizes self-signed rather than
Public Key Infrastructure (PKI) certificates, so that the expiration
check is to ensure that keys are not used indefinitely and additional
certificate checks are unnecessary.</p>
</li>
<li>
<p>Initialize <var>connection</var>'s [= ICE Agent =].</p>
</li>
<li data-tests="RTCConfiguration-iceTransportPolicy.html">
<p>If the value of <var>configuration</var>.{{RTCConfiguration/iceTransportPolicy}} is
<code>undefined</code>, set it to {{RTCIceTransportPolicy/"all"}}.</p>
</li>
<li data-tests="RTCConfiguration-bundlePolicy.html">
<p>If the value of <var>configuration</var>.{{RTCConfiguration/bundlePolicy}} is
<code>undefined</code>, set it to {{RTCBundlePolicy/"balanced"}}.</p>
</li>
<li data-tests="RTCConfiguration-rtcpMuxPolicy.html">
<p>If the value of <var>configuration</var>.{{RTCConfiguration/rtcpMuxPolicy}} is
<code>undefined</code>, set it to {{RTCRtcpMuxPolicy/"require"}}.</p>
</li>
<li data-tests="RTCConfiguration-iceServers.html,RTCConfiguration-iceCandidatePoolSize.html,RTCConfiguration-bundlePolicy.html,RTCConfiguration-iceTransportPolicy.html,RTCConfiguration-rtcpMuxPolicy.html">
<p>Let <var>connection</var> have a <dfn>[[\Configuration]]</dfn>
internal slot. [= Set the configuration =] specified by
<var>configuration</var>.</p>
</li>
<li data-tests="RTCPeerConnection-addTrack.https.html">
<p>Let <var>connection</var> have an <dfn>[[\IsClosed]]</dfn>
internal slot, initialized to <code>false</code>.</p>
</li>
<li data-tests="RTCPeerConnection-onnegotiationneeded.html">
<p>Let <var>connection</var> have a <dfn>[[\NegotiationNeeded]]</dfn>
internal slot, initialized to <code>false</code>.</p>
</li>
<li data-tests="RTCSctpTransport-constructor.html">
<p>Let <var>connection</var> have an <dfn>[[\SctpTransport]]</dfn>
internal slot, initialized to <code>null</code>.</p>
</li>
<li>
<p>Let <var>connection</var> have an <dfn>[[\Operations]]</dfn>
internal slot, representing an [= operations chain =], initialized
to an empty list.</p>
</li>
<li data-tests="RTCPeerConnection-setLocalDescription-parameterless.https.html">
<p>Let <var>connection</var> have an <dfn>[[\LastCreatedOffer]]</dfn>
internal slot, initialized to <code>""</code>.</p>
</li>
<li data-tests="RTCPeerConnection-setLocalDescription-parameterless.https.html">
<p>Let <var>connection</var> have an <dfn>[[\LastCreatedAnswer]]</dfn>
internal slot, initialized to <code>""</code>.</p>
</li>
<li class="untestable">
<p>Let <var>connection</var> have an <dfn>[[\EarlyCandidates]]</dfn>
internal slot, initialized to an empty list.</p>
</li>
<li data-tests="RTCPeerConnection-constructor.html">
<p>Set <var>connection</var>'s [= signaling state =] to
{{RTCSignalingState/"stable"}}.</p>
</li>
<li data-tests="RTCPeerConnection-constructor.html">
<p>Set <var>connection</var>'s [= ICE connection state =] to
{{RTCIceConnectionState/"new"}}.</p>
</li>
<li data-tests="RTCPeerConnection-constructor.html">
<p>Set <var>connection</var>'s [= ICE gathering state =] to
{{RTCIceGatheringState/"new"}}.</p>
</li>
<li data-tests="RTCPeerConnection-constructor.html">
<p>Set <var>connection</var>'s [= connection state =] to
{{RTCPeerConnectionState/"new"}}.</p>
</li>
<li data-tests="RTCPeerConnection-constructor.html">
<p>Let <var>connection</var> have a
<dfn>[[\PendingLocalDescription]]</dfn> internal slot, initialized
to <code>null</code>.</p>
</li>
<li data-tests="RTCPeerConnection-constructor.html">
<p>Let <var>connection</var> have a
<dfn>[[\CurrentLocalDescription]]</dfn> internal slot, initialized
to <code>null</code>.</p>
</li>
<li data-tests="RTCPeerConnection-constructor.html">
<p>Let <var>connection</var> have a
<dfn>[[\PendingRemoteDescription]]</dfn> internal slot, initialized
to <code>null</code>.</p>
</li>
<li data-tests="RTCPeerConnection-constructor.html">
<p>Let <var>connection</var> have a
<dfn>[[\CurrentRemoteDescription]]</dfn> internal slot, initialized