-
Notifications
You must be signed in to change notification settings - Fork 4
/
msortc.html
4626 lines (4143 loc) · 207 KB
/
msortc.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" dir="ltr" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Microsoft Object RTC (ORTC) Implementation</title>
<meta charset='utf-8'>
<script src="respec-w3c-common.js" async class="remove"></script>
<script class="remove">
var respecConfig = {
"specStatus": "CG-DRAFT",
"shortName": "ms-ortc",
"publishDate": "2017-05-26",
"editors": [
{ "name": "Microsoft Corporation",
"company": "Microsoft",
"companyURL": "https://www.microsoft.com/" }
],
"authors": [
],
"wg": "Microsoft Corporation",
"wgPatentURI": "",
"localBiblio": {
"IANA-RTP-2": {
title: "RTP Payload Format media types"
, href: "https://www.iana.org/assignments/rtp-parameters/rtp-parameters.xhtml#rtp-parameters-2"
, publisher: "IANA"
},
"IANA-RTP-10": {
title: "RTP Compact Header Extensions"
, href: "https://www.iana.org/assignments/rtp-parameters/rtp-parameters.xhtml#rtp-parameters-10"
, publisher: "IANA"
},
"IANA-SDP-14": {
title: "'rtcp-fb' Attribute Values"
, href: "https://www.iana.org/assignments/sdp-parameters/sdp-parameters.xhtml#sdp-parameters-14"
, publisher: "IANA"
},
"IANA-SDP-15": {
title: "'ack' and 'nack' Attribute Values"
, href: "https://www.iana.org/assignments/sdp-parameters/sdp-parameters.xhtml#sdp-parameters-15"
, publisher: "IANA"
},
"IANA-SDP-19": {
title: "Codec Control Messages"
, href: "https://www.iana.org/assignments/sdp-parameters/sdp-parameters.xhtml#sdp-parameters-19"
, publisher: "IANA"
},
"MUX-FIXES": {
title: "Multiplexing Scheme Updates for Secure Real-time Transport Protocol (SRTP) Extension for Datagram Transport Layer Security (DTLS)"
, href: "https://tools.ietf.org/html/draft-ietf-avtcore-rfc5764-mux-fixes"
, authors: [
"M. Petit-Huguenin"
, "G. Salgueiro"
]
, status: "24 March 2015. Internet draft (work in progress)"
, publisher: "IETF"
},
"OPUS-RTP": {
title: "RTP Payload Format for Opus Speech and Audio Codec"
, href: "https://tools.ietf.org/html/draft-ietf-payload-rtp-opus"
, authors: [
"J. Spittka"
, "K. Vos"
, "JM. Valin"
]
, status: "14 April 2015. Internet Draft (work in progress)"
, publisher: "IETF"
},
"RFC3264": {
title: "An Offer/Answer Model with the Session Description Protocol"
, href: "https://tools.ietf.org/html/rfc3264"
, authors: [
"J. Rosenberg"
, "H. Schulzrinne"
]
, status: "July 2002. RFC"
, publisher: "IETF"
},
"RFC4568": {
title: "SDP Security Descriptions for Media Streams"
, href: "https://tools.ietf.org/html/rfc4568"
, authors: [
"F. Andreasen"
, "M. Baugher"
, "D. Wing"
]
, status: "July 2006. RFC"
, publisher: "IETF"
},
"RFC4585": {
title: "Extended RTP Profile for RTCP-Based Feedback (RTP/AVPF)"
, href: "https://tools.ietf.org/html/rfc4585"
, authors: [
"J. Ott"
, "S. Wenger"
, "N. Sato"
, "C. Burmeister"
, "J. Rey"
]
, status: "July 2006. RFC"
, publisher: "IETF"
},
"RFC4733": {
title: "RTP Payload for DTMF Digits, Telephony Tones, and Telephony Signals"
, href: "https://tools.ietf.org/html/rfc4733"
, authors: [
"H. Schulzrinne"
, "T. Taylor"
]
, status: "December 2006. RFC"
, publisher: "IETF"
},
"RFC4961": {
title: "Symmetric RTP/RTC Control Protocol (RTCP)"
, href: "https://tools.ietf.org/html/rfc4961"
, authors: [
"D. Wing"
]
, status: "July 2007. RFC"
, publisher: "IETF"
},
"RFC5104": {
title: "Codec Control Messages in the RTP Audio-Visual Profile with Feedback (AVPF)"
, href: "https://tools.ietf.org/html/rfc5104"
, authors: [
"S. Wenger"
, "U. Chandra"
, "M. Westerlund"
, "B. Burman"
]
, status: "February 2008. RFC"
, publisher: "IETF"
},
"RFC5124": {
title: "Extended Secure RTP Profile for Real-time Transport Control Protocol (RTCP)-Based Feedback (RTP/SAVPF)"
, href: "https://tools.ietf.org/html/rfc5124"
, authors: [
"J. Ott"
, "E. Carrara"
]
, status: "February 2008. RFC"
, publisher: "IETF"
},
"RFC5450": {
title: "Transmission Time Offsets in RTP Streams"
, href: "https://tools.ietf.org/html/rfc5450"
, authors: [
"D. Singer"
, "H. Desineni"
]
, status: "March 2009. RFC"
, publisher: "IETF"
},
"RFC5506": {
title: "Support for Reduced-Size Real-Time Transport Control Protocol (RTCP): Opportunities and Consequences"
, href: "https://tools.ietf.org/html/rfc5506"
, authors: [
"I. Johansson"
, "M. Westerlund"
]
, status: "April 2009. RFC"
, publisher: "IETF"
},
"RFC5583": {
title: "Signaling Media Decoding Dependency in the SDP"
, href: "https://tools.ietf.org/html/rfc5583"
, authors: [
"T. Schierl"
, "S. Wenger"
]
, status: "July 2009. RFC"
, publisher: "IETF"
},
"RFC5761": {
title: "Multiplexing RTP Data and Control Packets on a Single Port"
, href: "https://tools.ietf.org/html/rfc5761"
, authors: [
"C. Perkins"
, "M. Westerlund"
]
, status: "April 2010. RFC"
, publisher: "IETF"
},
"RFC5764": {
title: "Datagram Transport Layer Security (DTLS) Extension to Establish Keys for the Secure Real-time Transport Protocol (SRTP)"
, href: "https://tools.ietf.org/html/rfc5764"
, authors: [
"D. McGrew"
, "E. Rescorla"
]
, status: "May 2010. RFC"
, publisher: "IETF"
},
"RFC6184": {
title: "RTP Payload Format for H.264 Video"
, href: "https://tools.ietf.org/html/rfc6184"
, authors: [
"Y.-K.. Wang"
, "R. Even"
, "T. Kristensen"
, "R. Jesup"
]
, status: "May 2011. RFC"
, publisher: "IETF"
},
"RFC6190": {
title: "RTP Payload Format for Scalable Video Coding"
, href: "https://tools.ietf.org/html/rfc6190"
, authors: [
"S. Wenger"
, "Y.-K. Wang"
, "T. Schierl"
, "A. Eleftheriadis"
]
, status: "May 2011. RFC"
, publisher: "IETF"
},
"RFC6455": {
title: "The WebSocket Protocol"
, href: "https://tools.ietf.org/html/rfc6455"
, authors: [
"I. Fette"
, "A. Melnikov"
]
, status: "December 2011. RFC"
, publisher: "IETF"
},
"RFC6544": {
title: "TCP Candidates with Interactive Connectivity Establishment (ICE)"
, href: "https://tools.ietf.org/html/rfc6544"
, authors: [
"J. Rosenberg"
, "A. Keranen"
, "B. B. Lowekamp"
, "A. B. Roach"
]
, status: "March 2012. RFC"
, publisher: "IETF"
},
"RFC6716": {
title: "Definition of the Opus Audio Codec"
, href: "https://tools.ietf.org/html/rfc6716"
, authors: [
"JM. Valin",
"K. Vos",
"T. Terriberry"
]
, status: "September 2012. RFC"
, publisher: "IETF"
},
"RFC7022": {
title: "Guidelines for Choosing RTP Control Protocol (RTCP) Canonical Names (CNAMEs)"
, href: "https://tools.ietf.org/html/rfc7022"
, authors: [
"A. Begen",
"C. Perkins",
"D. Wing",
"E. Rescorla"
]
, status: "September 2013. RFC"
, publisher: "IETF"
},
"RFC7064": {
title: "URI Scheme for Session Traversal Utilities for NAT (STUN) Protocol"
, href: "https://tools.ietf.org/html/rfc7064"
, authors: [
"S. Nandakumar",
"G. Salgueiro",
"P. Jones",
"M. Petit-Huguenin"
]
, status: "November 2013. RFC"
, publisher: "IETF"
},
"RFC7065": {
title: "Traversal Using Relays around NAT (TURN) Uniform Resource Identifiers"
, href: "https://tools.ietf.org/html/rfc7065"
, authors: [
"M. Petit-Huguenin",
"S. Nandakumar",
"G. Salgueiro",
"P. Jones"
]
, status: "November 2013. RFC"
, publisher: "IETF"
},
"BUNDLE": {
"title": "Negotiating Media Multiplexing Using the Session Description Protocol (SDP)",
"href": "https://tools.ietf.org/html/draft-ietf-mmusic-sdp-bundle-negotiation",
"authors": [
"C. Holmberg",
"H. Alvestrand",
"C. Jennings"
],
"status": "12 April 2017. Internet Draft (work in progress)",
"publisher": "IETF"
},
"CONSENT": {
title: "STUN Usage for Consent Freshness"
, href: "https://tools.ietf.org/html/draft-ietf-rtcweb-stun-consent-freshness"
, authors: [
"M. Perumal",
"D. Wing",
"T. Reddy",
"M. Thomson"
]
, status: "8 June 2015. Internet Draft (work in progress)"
, publisher: "IETF"
},
"GROUPING": {
title: "RTP Grouping Taxonomy"
, href: "https://tools.ietf.org/html/draft-ietf-avtext-rtp-grouping-taxonomy"
, authors: [
"J. Lennox",
"K. Gross",
"S. Nandakumar",
"G. Salgueiro",
"B. Burman"
]
, status: "05 March 2015. Internet Draft (work in progress)"
, publisher: "IETF"
},
"MS-DTMF": {
title: "RTP Payload for DTMF Digits, Telephony Tones, and Telephony Signals Extensions"
, href: "https://msdn.microsoft.com/en-us/library/office/cc431502(v=office.12).aspx"
, authors: [
"Microsoft"
]
, status: "30 March 2015."
, publisher: "Microsoft"
},
"MS-H264PF": {
title: "RTP Payload Format for H.264 Video Streams Extensions"
, href: "https://msdn.microsoft.com/en-us/library/hh659565(v=office.12).aspx"
, authors: [
"Microsoft"
]
, status: "30 March 2015."
, publisher: "Microsoft"
},
"MS-ICE": {
title: "Interactive Connectivity Establishment (ICE) Extensions"
, href: "https://msdn.microsoft.com/en-us/library/office/Cc431495(v=office.12).aspx"
, authors: [
"Microsoft"
]
, status: "30 March 2015."
, publisher: "Microsoft"
},
"MS-ICE2": {
title: "Interactive Connectivity Establishment (ICE) Extensions 2.0"
, href: "https://msdn.microsoft.com/en-us/library/office/cc431504(v=office.12).aspx"
, authors: [
"Microsoft"
]
, status: "30 March 2015."
, publisher: "Microsoft"
},
"MS-QoE": {
title: "Quality of Experience Monitoring Server Protocol"
, href: "https://msdn.microsoft.com/en-us/library/office/cc431512(v=office.12).aspx"
, authors: [
"Microsoft"
]
, status: "14 September 2016."
, publisher: "Microsoft"
},
"MS-ICE": {
title: "[MS-ICE]: Interactive Connectivity Establish (ICE) Extensions"
, href: "https://msdn.microsoft.com/en-us/library/dd922095%28v=office.12%29.aspx"
, authors: [
"Microsoft"
]
, status: "30 October 2014."
, publisher: "Microsoft"
},
"MS-RTP": {
title: "Real-time Transport Protocol (RTP) Extensions"
, href: "https://msdn.microsoft.com/en-us/library/office/cc431492(v=office.12).aspx"
, authors: [
"Microsoft"
]
, status: "30 March 2015."
, publisher: "Microsoft"
},
"MS-RTPRADEX": {
title: "RTP Payload for Redundant Audio Data Extensions"
, href: "https://msdn.microsoft.com/en-us/library/office/cc431513(v=office.12).aspx"
, authors: [
"Microsoft"
]
, status: "30 March 2015."
, publisher: "Microsoft"
},
"MS-SDPEXT": {
title: "Session Description Protocol (SDP) Version 2.0 Extensions"
, href: "https://msdn.microsoft.com/en-us/library/cc431514(v=office.12).aspx"
, authors: [
"Microsoft"
]
, status: "30 March 2015."
, publisher: "Microsoft"
},
"MS-TURN": {
title: "Traversal Using Relay NAT (TURN) Extensions"
, href: "https://msdn.microsoft.com/en-us/library/cc431507(v=office.12).aspx"
, authors: [
"Microsoft"
]
, status: "30 March 2015."
, publisher: "Microsoft"
},
"RTCWEB-SECURITY": {
title: "Security Considerations for WebRTC"
, href: "https://tools.ietf.org/html/draft-ietf-rtcweb-security"
, authors: [
"E. Rescorla"
]
, status: "26 February 2015. Internet Draft (work in progress)"
, publisher: "IETF"
},
"RTCWEB-SECURITY-ARCH": {
title: "WebRTC Security Architecture"
, href: "https://tools.ietf.org/html/draft-ietf-rtcweb-security-arch"
, authors: [
"E. Rescorla"
]
, status: "07 March 2015. Internet Draft (work in progress)"
, publisher: "IETF"
},
"RTCWEB-AUDIO": {
title: "WebRTC Audio Codec and Processing Requirements"
, href: "https://tools.ietf.org/html/draft-ietf-rtcweb-audio"
, authors: [
"JM. Valin"
,"C. Bran"
]
, status: "30 April 2015. Internet Draft (work in progress)"
, publisher: "IETF"
},
"RTCWEB-VIDEO": {
title: "WebRTC Video Processing and Codec Requirements"
, href: "https://tools.ietf.org/html/draft-ietf-rtcweb-video"
, authors: [
"A.B. Roach"
]
, status: "12 June 2015. Internet Draft (work in progress)"
, publisher: "IETF"
},
"RTP-MULTI-STREAM": {
title: "Sending Multiple Types of Media in a Single RTP Session"
, href: "https://tools.ietf.org/html/draft-ietf-avtcore-multi-media-rtp-session"
, authors: [
"M. Westerlund"
, "C. Perkins"
, "J. Lennox"
]
, status: "09 March 2015. Internet Draft (work in progress)"
, publisher: "IETF"
},
"RTP-USAGE": {
title: "Web Real-Time Communication (WebRTC): Media Transport and Use of RTP"
, href: "https://tools.ietf.org/html/draft-ietf-rtcweb-rtp-usage"
, authors: [
"C. Perkins"
, "M. Westerlund"
, "J. Ott"
]
, status: "12 June 2015. Internet Draft (work in progress)"
, publisher: "IETF"
},
"SILK": {
title: "SILK Speech Codec"
, href: "https://tools.ietf.org/html/draft-vos-silk"
, authors: [
"K. Vos"
, "S. Jensen"
, "K. Soerensen"
]
, status: "8 March 2010. Internet Draft (work in progress)"
, publisher: "IETF"
},
"VP8-RTP": {
title: "RTP Payload Format for VP8 Video"
, href: "https://tools.ietf.org/html/draft-ietf-payload-vp8"
, authors: [
"P. Westin",
"H. Lundin",
"M. Glover",
"J. Uberti",
"F. Galligan"
]
, status: "05 June 2015. Internet Draft (work in progress)"
, publisher: "IETF"
},
"WEBRTC-STATS": {
title: "Identifiers for WebRTC's Statistics API"
, href: "https://www.w3.org/TR/webrtc-stats/"
, authors: [
"Harald Alvestrand",
"Varun Singh"
]
, status: "06 February 2015 (work in progress)"
, publisher: "W3C"
}
}
};
</script>
</head>
<body>
<section id="abstract">
<p>
This document describes the Microsoft Edge browser's initial implementation of the ORTC API,
as of September 1, 2015.
The Microsoft Edge implementation differs from the most recent version of the
<a href="http://draft.ortc.org/">ORTC API</a> since ORTC has continued to evolve since the development of
Microsoft Edge got underway. In addition, Microsoft Edge does not implement every object or method
within the ORTC API, and includes extensions not currently incorporated within the specification.
Since both Microsoft Edge and this document represent works-in-progress, the behavior of Microsoft Edge can
change substantially from build-to-build. Please bring questions, errors and omissions to the attention of the
Edge RTC team (Bernard Aboba, bernarda@microsoft and Shijun Sun, shijuns@microsoft.com).
</p>
</section>
<section id='sotd'>
</section>
<section id="overview*">
<h2><span class="secno"> </span>Overview</h2>
<p>Microsoft's Object Real-Time Communications (ORTC) API implementation enables the development of WebRTC applications.
<p>
Within Microsoft's implementation,
the relationship between the application and the objects, as well
as between the objects themselves is shown below.
Horizontal or slanted arrows denote the flow of media or data,
whereas vertical arrows denote interactions via methods and events.
</p>
<img alt="The non-normative ORTC Big Picture Diagram" src="images/ms-ortc.png" style="width:100%" />
<p>In the figure above, the <code><a>RTCRtpSender</a></code> (<a href="#rtcrtpsender*">Section 6</a>) encodes the
track provided as input, which is transported over a <code><a>RTCDtlsTransport</a></code>
(<a href="#rtcdtlstransport*">Section 4</a>) or an <code><a>RTCSrtpSdesTransport</a></code>
(<a href="#rtcsrtpsdestransport*">Section 5</a>).
Sending of Dual Tone Multi Frequency (DTMF) tones is supported via the
<code><a>RTCDtmfSender</a></code> (<a href="#rtcdtmfsender*">Section 9</a>).</p>
<p>The <code><a>RTCDtlsTransport</a></code> and <code><a>RTCSrtpSdesTransport</a></code> utilize an <code><a>RTCIceTransport</a></code>
(<a href="#rtcicetransport*">Section 3</a>) to select a communication path to reach the
receiving peer's <code><a>RTCIceTransport</a></code>, which is in turn associated with
an <code><a>RTCDtlsTransport</a></code> or <code><a>RTCSrtpSdesTransport</a></code> which de-multiplexes
media to the <code><a>RTCRtpReceiver</a></code> (<a href="#rtcrtpreceiver*">Section 7</a>).
The <code><a>RTCRtpReceiver</a></code> then decodes media, producing a track which is rendered
by an audio or video tag.</p>
<p>Several other objects also play a role.
The <code><a>RTCIceGatherer</a></code> (<a href="#rtcicegatherer*">Section 2</a>) gathers local ICE candidates for use by a single
<code><a>RTCIceTransport</a></code> object.</p>
<div class="note">
<p>Edge Interop Note: Since Microsoft Edge does not implement the data channel, the <code>RTCDataChannel</code> and <code>RTCSctpTransport</code> objects are not supported.
</p>
</div>
<p>Remaining sections of the specification fill in details relating to RTP capabilities and parameters,
operational statistics and compatibility with the
WebRTC 1.0 API.
RTP dictionaries are described in <a href="#rtcrtpdictionaries*">Section 8</a>,
the Statistics API is described in <a href="#statistics-api">Section 10</a>,
Microsoft extensions related to the H.264UC codec [[MS-H264PF]] and statistics are described in <a href="#msextensions*">Section 11</a>,
an event summary is provided in <a href="#event-summary">Section 12</a>,
a list of error codes is provided in <a href="#error-codes*">Section 13</a>
and WebRTC 1.0 compatibility issues are discussed in <a href="#webrtc-compat*">Section 14</a>.
</p>
<p>Complete examples are provided in <a href="#examples*">Section 15</a>.</p>
<section>
<h3>Terminology</h3>
<p>The <code><a href=
"http://dev.w3.org/html5/spec/webappapis.html#eventhandler">EventHandler</a></code>
interface represents a callback used for event handlers as defined in
[[!HTML5]].</p>
<p>The concepts <dfn><a href=
"http://dev.w3.org/html5/spec/webappapis.html#queue-a-task">queue a
task</a></dfn> and <dfn><a href=
"http://dev.w3.org/html5/spec/webappapis.html#fire-a-simple-event">fires a
simple event</a></dfn> are defined in [[!HTML5]].</p>
<p>The terms <dfn>event</dfn>, <dfn><a href=
"http://dev.w2.org/html5/spec/webappapis.html#event-handlers">event
handlers</a></dfn> and <dfn><a href=
"http://dev.w3.org/html5/spec/webappapis.html#event-handler-event-type">event
handler event types</a></dfn> are defined in [[!HTML5]].</p>
<p>The terms <dfn>MediaStream</dfn> and <dfn>MediaStreamTrack</dfn>
are defined in
[[!GETUSERMEDIA]].</p>
<p>For Scalable Video Coding (SVC), the terms single-session transmission (<dfn>SST</dfn>) and multi-session transmission (<dfn>MST</dfn>)
are defined in [[RFC6190]]. This specification only supports <a>SST</a> but not <a>MST</a>.
The term Single Real-time transport protocol stream Single Transport (<dfn>SRST</dfn>),
defined in [[GROUPING]] Section 3.7, refers to an SVC implementation that transmits all layers within a
single transport, using a single Real-time Transport Protocol (RTP) stream and synchronization source (SSRC).
The term Multiple RTP stream Single Transport (<dfn>MRST</dfn>), also defined in [[GROUPING]] Section 3.7, refers
to an implementation that transmits all layers within a single transport, using multiple RTP streams with
a distinct SSRC for each layer.</p>
</section>
</section>
<section id="rtcicegatherer*">
<h2>The RTCIceGatherer Object</h2>
<p>
The <dfn>RTCIceGatherer</dfn> gathers local host, server reflexive and relay candidates, as
well as enabling the retrieval of local Interactive Connectivity Establishment (ICE) parameters which can be exchanged in signaling.
</p>
<section id="rtcicegatherer-overview*">
<h3>Overview</h3>
<p>The Microsoft Edge implementation of the <code><a>RTCIceGatherer</a></code> does not support
the <var>component</var> or <var>state</var> attributes, nor does it support the
<code>close()</code> method or the <code>ongatherstatechange</code> event handler.
</p>
<div class="note">
<p>Edge Interop Note: In the Microsoft Edge implementation, an <code><a>RTCIceGatherer</a></code> instance can only
be associated to a single <code><a>RTCIceTransport</a></code>
object. As a result, forking scenarios are not supported.
The <code><a>RTCIceGatherer</a></code> prunes local candidates when its
associated <code><a>RTCIceTransport</a></code> object enters the "completed" state.
</p>
</div>
<p>As noted in [[!RFC5245]] Section 7.1.2.2, an incoming connectivity check contains an <code>ICE-CONTROLLING</code>
or <code>ICE-CONTROLLED</code> attribute, depending on the role of the ICE agent initiating the check.
Since an <code><a>RTCIceGatherer</a></code> object does not have a role, it cannot determine whether
to respond to an incoming connectivity check with a 487 (Role Conflict) error; however, it can validate
that an incoming connectivity check utilizes the correct local username fragment and password,
and if not, can respond with an
401 (Unauthorized) error, as described in [[!RFC5389]] Section 10.1.2.</p>
<p>For incoming connectivity checks that pass validation, the <code><a>RTCIceGatherer</a></code>
<em class="rfc2119" title="MUST">MUST</em>
buffer incoming connectivity checks so as to be able to provide them to associated
<code><a>RTCIceTransport</a></code> objects so that they can respond.</p>
</section>
<section id="rtcicegatherer-operation*">
<h3>Operation</h3>
<p>An <code><a>RTCIceGatherer</a></code> instance is constructed from an
<code><a>RTCIceGatherOptions</a></code> object.
</p>
</section>
<section id="rtcicegatherer-interface-definition*">
<h3>Interface Definition</h3>
<dl class="idl" title="[Constructor(RTCIceGatherOptions options)] interface RTCIceGatherer : RTCStatsProvider">
<dt>readonly attribute RTCIceComponent component</dt>
<dd><p>The component-id of the <code><a>RTCIceGatherer</a></code>.</p></dd>
<dt>RTCIceParameters getLocalParameters()</dt>
<dd><p>Obtain the ICE parameters of the <code><a>RTCIceGatherer</a></code>.</p></dd>
<dt>sequence<RTCIceCandidate> getLocalCandidates()</dt>
<dd><p>Retrieve the sequence of valid local candidates associated with the
<code><a>RTCIceGatherer</a></code>.
This retrieves all unpruned local candidates currently known (except for peer reflexive candidates),
even if an <code><a>onlocalcandidate</a></code>
event hasn't been processed yet. In Microsoft Edge, if <code>getLocalCandidates()</code> is called prior to emitting of the
first candidate, an exception is thrown.
</p></dd>
<dt>RTCIceGatherer createAssociatedGatherer()</dt>
<dd><p>Create an associated <code><a>RTCIceGatherer</a></code> for RTCP, with the same
<code><a>RTCIceParameters</a></code> and <code><a>RTCIceGatherOptions</a></code>.
If an <code><a>RTCIceGatherer</a></code> calls the method more than once,
or if <var>component</var> is "RTCP", throw
an <code>InvalidStateError</code> exception.
</p></dd>
<dt>attribute EventHandler? onerror</dt>
<dd><p>This event handler, of event handler type <code>error</code>,
<em class="rfc2119" title="MUST">MUST</em> be supported by all objects
implementing the <code><a>RTCIceGatherer</a></code> interface.
If TURN credentials are invalid, then this event <em class="rfc2119" title="MUST">MUST</em>
be fired.
</p></dd>
<dt>attribute EventHandler? onlocalcandidate</dt>
<dd><p>This event handler, of event handler event type <code>icecandidate</code>, uses
the <code><a>RTCIceGathererEvent</a></code> interface.
It <em class="rfc2119" title="MUST">MUST</em> be supported by all objects implementing the
<code><a>RTCIceGatherer</a></code> interface.
It receives events when a new local ICE candidate is available. Since ICE candidate gathering begins once
an <code><a>RTCIceGatherer</a></code> object is created,
<code>candidate</code> events are queued until an <code>onlocalcandidate</code> event handler is assigned.
When the final candidate is gathered, a <code>candidate</code> event occurs with an <code>RTCIceCandidateComplete</code> emitted.
</p></dd>
</dl>
</section>
<section id="rtciceparameters*">
<h3>The RTCIceParameters Object</h3>
<p>
The <dfn>RTCIceParameters</dfn> object includes the ICE username fragment and password.
</p>
<dl class="idl" title="dictionary RTCIceParameters">
<dt>DOMString usernameFragment</dt>
<dd><p>ICE username.</p></dd>
<dt>DOMString password</dt>
<dd><p>ICE password.</p></dd>
</dl>
</section>
<section id="rtcicecandidate*">
<h3>The RTCIceCandidate Object</h3>
<p>
The <dfn>RTCIceCandidate</dfn> object includes information relating to an ICE candidate.
</p>
<pre xml:space="preserve" class='example highlight'>
foundation: "abcd1234",
priority: 1694498815,
ip: "192.0.2.33",
protocol: "udp",
port: 10000,
type: "host"
};
</pre>
<dl class="idl" title="typedef (RTCIceCandidate or RTCIceCandidateComplete) RTCIceGatherCandidate">
</dl>
<dl class="idl" title="dictionary RTCIceCandidate">
<dt>DOMString foundation</dt>
<dd>
<p>A unique identifier that allows ICE to correlate candidates that appear on multiple <code><a>RTCIceTransport</a></code>s.</p>
</dd>
<dt>unsigned long priority</dt>
<dd><p>The assigned priority of the candidate. This is automatically populated by the browser.</p></dd>
<dt>DOMString ip</dt>
<dd><p>The IP address of the candidate.</p></dd>
<dt>RTCIceProtocol protocol</dt>
<dd><p>The protocol of the candidate (UDP/TCP).</p></dd>
<dt>unsigned short port</dt>
<dd><p>The port for the candidate.</p></dd>
<dt>DOMString interfaceType</dt>
<dd><p>The interface type for the candidate. Types include "lan", "wlan", "wwan" and "vpn".
Not supported in Microsoft Edge.</p></dd>
<dt>RTCIceCandidateType type</dt>
<dd><p>The type of candidate.</p></dd>
<dt>RTCIceTcpCandidateType tcpType=null</dt>
<dd><p>The type of TCP candidate.</p></dd>
<dt>DOMString relatedAddress=""</dt>
<dd>
<p>For candidates that are derived from others, such as relay or reflexive candidates, the <dfn>relatedAddress</dfn>
refers to the candidate that these are derived from. For host candidates, the <var>relatedAddress</var>
is set to the empty string.</p>
</dd>
<dt>unsigned short relatedPort=null</dt>
<dd>
<p>For candidates that are derived from others, such as relay or reflexive candidates, the <dfn>relatedPort</dfn>
refers to the host candidate that these are derived from. For host candidates, the <var>relatedPort</var>
is null.</p>
</dd>
</dl>
<section>
<h4>The RTCIceProtocol</h4>
<p>
The <dfn>RTCIceProtocol</dfn> includes the protocol of the ICE candidate.
</p>
<dl class="idl" title="enum RTCIceProtocol">
<dt>udp</dt>
<dd><p>A UDP candidate, as described in [[!RFC5245]].</p></dd>
<dt>tcp</dt>
<dd><p>A TCP candidate, as described in [[!RFC6544]].</p></dd>
</dl>
</section>
<section>
<h4>The RTCIceTcpCandidateType</h4>
<p>
The <dfn>RTCIceTcpCandidateType</dfn> includes the type of the ICE TCP candidate, as described in [[!RFC6544]].
Browsers MUST gather active TCP candidates and only active TCP candidates.
Servers and other endpoints MAY gather active, passive or so candidates.
</p>
<dl class="idl" title="enum RTCIceTcpCandidateType">
<dt>active</dt>
<dd><p>An active TCP candidate is one for which the transport will
attempt to open an outbound connection but will not receive incoming
connection requests.</p></dd>
<dt>passive</dt>
<dd><p>A passive TCP candidate is one for which the transport
will receive incoming connection attempts but not attempt a
connection.</p></dd>
<dt>so</dt>
<dd><p>An so candidate is one for which the transport will attempt
to open a connection simultaneously with its peer.</p></dd>
</dl>
</section>
<section>
<h4>The RTCIceCandidateType</h4>
<p>
The <dfn>RTCIceCandidateType</dfn> includes the type of the ICE candidate.
</p>
<dl class="idl" title="enum RTCIceCandidateType">
<dt>host</dt>
<dd><p>A host candidate.</p></dd>
<dt>srflx</dt>
<dd><p>A server reflexive candidate.</p></dd>
<dt>prflx</dt>
<dd><p>A peer reflexive candidate.</p></dd>
<dt>relay</dt>
<dd><p>A relay candidate.</p></dd>
</dl>
</section>
</section>
<section id="rtcicecandidatecomplete*">
<h3>dictionary RTCIceCandidateComplete</h3>
<p>
<dfn>RTCIceCandidateComplete</dfn> is a dictionary signifying that all <code>RTCIceCandidate</code>s are gathered.
<p>
<dl class="idl" title="dictionary RTCIceCandidateComplete">
</dl>
</section>
<section>
<h4>RTCIceGathererEvent</h4>
<p>The <code>icecandidate</code> event of the <code><a>RTCIceGatherer</a></code> object uses
the <code><a>RTCIceGathererEvent</a></code> interface.</p>
<p>Firing an
<code><a>RTCIceGathererEvent</a></code> event named
<var>e</var> with an <code><a>RTCIceGatherCandidate</a></code>
<var>candidate</var> means that an event with the name <var>e</var>,
which does not bubble (except where otherwise stated) and is not
cancelable (except where otherwise stated), and which uses the
<code><a>RTCIceGathererEvent</a></code> interface with the
<var>candidate</var> attribute set to the new ICE candidate,
<em class="rfc2119" title="MUST">MUST</em> be
created and dispatched at the given target.</p>
<dl class="idl" data-merge="RTCIceGathererEventInit" title=
"[Constructor(DOMString type, RTCIceGathererEventInit eventInitDict)] interface RTCIceGathererEvent : Event">
<dt>readonly attribute RTCIceGatherCandidate candidate</dt>
<dd>
<p>The <var>candidate</var> attribute is the
<code><a>RTCIceGatherCandidate</a></code> object with the new ICE
candidate that caused the event.
If <var>candidate</var> is of type <code>RTCIceCandidateComplete</code>,
there are no additional candidates.
</p>
</dd>
</dl>
<dl class="idl" title=
"dictionary RTCIceGathererEventInit : EventInit">
<dt>RTCIceGatherCandidate candidate</dt>
<dd>
<p>The ICE candidate that caused the event.</p>
</dd>
</dl>
</section>
<section id="rtcicegatheroptions*">
<h3>dictionary RTCIceGatherOptions</h3>
<p><dfn>RTCIceGatherOptions</dfn> provides options relating to the gathering of ICE candidates.</p>
<dl class="idl" title=
"dictionary RTCIceGatherOptions">
<dt>RTCIceGatherPolicy gatherPolicy</dt>
<dd><p>The ICE gather policy.</p></dd>
<dt>sequence<RTCIceServer> iceservers</dt>
<dd><p>The ICE servers to be configured.</p></dd>
</dl>
</section>
<section id="rtcicegatherpolicy*">
<h3>enum RTCIceGatherPolicy</h3>
<p><dfn>RTCIceGatherPolicy</dfn> denotes the policy relating to the gathering of ICE candidates.</p>
<dl class="idl" title="enum RTCIceGatherPolicy">
<dt>all</dt>
<dd><p>The ICE gatherer gathers all types of candidates when this value is specified.</p></dd>
<dt>nohost</dt>
<dd><p>The ICE gatherer gathers all ICE candidate types except for host candidates.</p></dd>
<dt>relay</dt>
<dd><p>The ICE gatherer <em class="rfc2119" title="MUST">MUST</em> only gather media relay candidates such as candidates passing through a TURN server.
This can be used to reduce leakage of IP addresses in certain use cases.</p></dd>
</dl>
</section>
<section id="rtciceserver*">
<h3>The RTCIceServer Object</h3>
<p>
The <dfn>RTCIceServer</dfn> is used to provide STUN or TURN server configuration.
In network topologies with multiple layers of NATs, it is desirable to have a STUN server
between every layer of NATs in addition to the TURN servers to minimize the peer to peer network latency.
<p>
</p>
An example of an array of <code<<a>RTCIceServer</a></code> objects supporting the STUN and TURN standards:
</p>
<pre xml:space="preserve" class='example highlight'>
[ { urls: "stun:stun1.example.net" } ,
{ urls:"turn:turn.example.org", username: "user", credential:"myPassword"}
]
</pre>
</p>
An example of an array of <code<<a>RTCIceServer</a></code> objects supporting [[MS-TURN]]:
</p>
<pre xml:space="preserve" class='example highlight'>
[ { urls: "stun:stun1.example.net" } ,
{ urls:"msturn:turn.example.org", username: "user", credential:"myPassword"}
]
</pre>
<div class="note">
<p>Edge Interop Note: Inclusion of the MSTURN URI triggers use of a proprietary TURN variant described in [[MS-TURN]], as well as proprietary ICE behavior
described in [[MS-ICE]] and [[MS-ICE2]].
The MSTURN URI should therefore not be used in scenarios requiring interoperability with other browsers.
The STUN URI is not currently supported.
</p>
</div>
<dl class="idl" title="dictionary RTCIceServer">
<dt>(DOMString or sequence<DOMString>) urls</dt>
<dd><p>STUN or TURN URI(s) as defined in [[!RFC7064]] and [[!RFC7065]] or other URI types (such as the MSTURN URI, described in [[MS-TURN]]).</p></dd>
<dt>DOMString username</dt>
<dd><p>If this <code><a>RTCIceServer</a></code> object represents a TURN server, then this attribute specifies
the username to use with that TURN server.</p></dd>
<dt>DOMString credential</dt>
<dd><p>If this <code><a>RTCIceServer</a></code> represents a TURN server, then this attribute specifies the credential to use with that TURN server.</p></dd>
</dl>
</section>
<section id="rtcicegatherer-initial-example*">
<h3>Example</h3>
<pre xml:space="preserve" class='example highlight'>
// Include some helper functions
import "helper.js";
// Create ICE gather options
var gatherOptions = new RTCIceGatherOptions();
gatherOptions.gatherPolicy = RTCIceGatherPolicy.relay;
gatherOptions.iceservers = [ { urls: "stun:stun1.example.net" } ,
{ urls:"turn:turn.example.org", username: "user", credential:"myPassword"} ];
// Create ICE gatherer objects
var iceGatherer = new RTCIceGatherer(gatherOptions);
// Prepare to signal local candidates as well as "end of candidates"
iceGatherer.onlocalcandidate = function (event) {
mySendLocalCandidate(event.candidate);
};
// Set up response function
mySignaller.onResponse = function(responseSignaller,response) {
// The Microsoft Edge ORTC implementation only supports a single response.
};
mySignaller.send({
"ice": iceGatherer.getLocalParameters()
});
</pre>
<pre xml:space="preserve" class='example highlight'>
// Helper functions used in all the examples (helper.js)
function trace(text) {
// This function is used for logging.
if (text[text.length - 1] === '\n') {
text = text.substring(0, text.length - 1);
}
if (window.performance) {
var now = (window.performance.now() / 1000).toFixed(3);
console.log(now + ': ' + text);
} else {
console.log(text);
}
}
function errorHandler (error) {
trace('Error encountered: ' + error.name);
}
function mySendLocalCandidate(candidate, component, kind){
// Set default values
kind = kind || "all";
component = component || RTCIceComponent.RTP;