forked from w3c/mediacapture-main
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebrtc-20120316.html
3630 lines (2952 loc) · 225 KB
/
webrtc-20120316.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
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr">
<head>
<meta content="HTML Tidy for Linux/x86 (vers 11 February 2007), see www.w3.org" name="generator" />
<link type="text/css" rel="stylesheet" href="webrtc.css" />
<title>WebRTC 1.0: Real-time Communication Between Browsers</title>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<!--
=== NOTA BENE ===
For the three scripts below, if your spec resides on dev.w3 you can check them
out in the same tree and use relative links so that they'll work offline.
To tag a new releas in git hub
Once the version is checked in and ready to go, you tag it with (need
to chance the 20110823 to correct date )
git tag -a v20110823 -m "This is release 20110823"
Tags are not transferred by default with the push so you have to
add a - -tags parameter to the push so it looks like. Note you need to
remoce the space between the - and -tag to make a double dash.
git push - -tags
or alternatively you can push just the new tag with
git push origin v20110823
To generate the dated version of the specification:
Open this doc in Mozilla.
Do a CTRL-ALT-SHIFT-S
Select "XHMTL( source)" from dialog box. This will pop a new tab with
genreated version of the document.
This will open a new tab with generated html. Copy and paste this to
a new file. Note if you use Chrome or Safari, this step will not
work. What will happen is the paste will have the original document,
not what was displayed in the window that you did the copy on.
Rename the new file to the correct day such as
webrtc-broken-20111003.html then search for and edit the links for
"This version" and "Previos version". Add the new file into CVS and
check in.
Once everyone is happy, the webrtc-broken.html and
webrtc-broken-20111003.html files can be coppied to
webrtc.html and webrtc-20111003.html
respectively in the ../editor/. directory.
-->
<style type="text/css">
/*****************************************************************
* ReSpec CSS
* Robin Berjon (robin at berjon dot com)
* v0.05 - 2009-07-31
*****************************************************************/
/* --- INLINES --- */
em.rfc2119 {
text-transform: lowercase;
font-variant: small-caps;
font-style: normal;
color: #900;
}
h1 acronym, h2 acronym, h3 acronym, h4 acronym, h5 acronym, h6 acronym, a acronym,
h1 abbr, h2 abbr, h3 abbr, h4 abbr, h5 abbr, h6 abbr, a abbr {
border: none;
}
dfn {
font-weight: bold;
}
a.internalDFN {
color: inherit;
border-bottom: 1px solid #99c;
text-decoration: none;
}
a.externalDFN {
color: inherit;
border-bottom: 1px dotted #ccc;
text-decoration: none;
}
a.bibref {
text-decoration: none;
}
code {
color: #ff4500;
}
/* --- WEB IDL --- */
pre.idl {
border-top: 1px solid #90b8de;
border-bottom: 1px solid #90b8de;
padding: 1em;
line-height: 120%;
}
pre.idl::before {
content: "WebIDL";
display: block;
width: 150px;
background: #90b8de;
color: #fff;
font-family: initial;
padding: 3px;
font-weight: bold;
margin: -1em 0 1em -1em;
}
.idlType {
color: #ff4500;
font-weight: bold;
text-decoration: none;
}
/*.idlModule*/
/*.idlModuleID*/
/*.idlInterface*/
.idlInterfaceID, .idlDictionaryID {
font-weight: bold;
color: #005a9c;
}
.idlSuperclass {
font-style: italic;
color: #005a9c;
}
/*.idlAttribute*/
.idlAttrType, .idlFieldType, .idlMemberType {
color: #005a9c;
}
.idlAttrName, .idlFieldName, .idlMemberName {
color: #ff4500;
}
.idlAttrName a, .idlFieldName a, .idlMemberName a {
color: #ff4500;
border-bottom: 1px dotted #ff4500;
text-decoration: none;
}
/*.idlMethod*/
.idlMethType {
color: #005a9c;
}
.idlMethName {
color: #ff4500;
}
.idlMethName a {
color: #ff4500;
border-bottom: 1px dotted #ff4500;
text-decoration: none;
}
/*.idlParam*/
.idlParamType {
color: #005a9c;
}
.idlParamName {
font-style: italic;
}
.extAttr {
color: #666;
}
/*.idlConst*/
.idlConstType {
color: #005a9c;
}
.idlConstName {
color: #ff4500;
}
.idlConstName a {
color: #ff4500;
border-bottom: 1px dotted #ff4500;
text-decoration: none;
}
/*.idlException*/
.idlExceptionID {
font-weight: bold;
color: #c00;
}
.idlTypedefID, .idlTypedefType {
color: #005a9c;
}
.idlRaises, .idlRaises a.idlType, .idlRaises a.idlType code, .excName a, .excName a code {
color: #c00;
font-weight: normal;
}
.excName a {
font-family: monospace;
}
.idlRaises a.idlType, .excName a.idlType {
border-bottom: 1px dotted #c00;
}
.excGetSetTrue, .excGetSetFalse, .prmNullTrue, .prmNullFalse, .prmOptTrue, .prmOptFalse {
width: 45px;
text-align: center;
}
.excGetSetTrue, .prmNullTrue, .prmOptTrue { color: #0c0; }
.excGetSetFalse, .prmNullFalse, .prmOptFalse { color: #c00; }
.idlImplements a {
font-weight: bold;
}
dl.attributes, dl.methods, dl.constants, dl.fields, dl.dictionary-members {
margin-left: 2em;
}
.attributes dt, .methods dt, .constants dt, .fields dt, .dictionary-members dt {
font-weight: normal;
}
.attributes dt code, .methods dt code, .constants dt code, .fields dt code, .dictionary-members dt code {
font-weight: bold;
color: #000;
font-family: monospace;
}
.attributes dt code, .fields dt code, .dictionary-members dt code {
background: #ffffd2;
}
.attributes dt .idlAttrType code, .fields dt .idlFieldType code, .dictionary-members dt .idlMemberType code {
color: #005a9c;
background: transparent;
font-family: inherit;
font-weight: normal;
font-style: italic;
}
.methods dt code {
background: #d9e6f8;
}
.constants dt code {
background: #ddffd2;
}
.attributes dd, .methods dd, .constants dd, .fields dd, .dictionary-members dd {
margin-bottom: 1em;
}
table.parameters, table.exceptions {
border-spacing: 0;
border-collapse: collapse;
margin: 0.5em 0;
width: 100%;
}
table.parameters { border-bottom: 1px solid #90b8de; }
table.exceptions { border-bottom: 1px solid #deb890; }
.parameters th, .exceptions th {
color: #fff;
padding: 3px 5px;
text-align: left;
font-family: initial;
font-weight: normal;
text-shadow: #666 1px 1px 0;
}
.parameters th { background: #90b8de; }
.exceptions th { background: #deb890; }
.parameters td, .exceptions td {
padding: 3px 10px;
border-top: 1px solid #ddd;
vertical-align: top;
}
.parameters tr:first-child td, .exceptions tr:first-child td {
border-top: none;
}
.parameters td.prmName, .exceptions td.excName, .exceptions td.excCodeName {
width: 100px;
}
.parameters td.prmType {
width: 120px;
}
table.exceptions table {
border-spacing: 0;
border-collapse: collapse;
width: 100%;
}
/* --- TOC --- */
.toc a {
text-decoration: none;
}
a .secno {
color: #000;
}
/* --- TABLE --- */
table.simple {
border-spacing: 0;
border-collapse: collapse;
border-bottom: 3px solid #005a9c;
}
.simple th {
background: #005a9c;
color: #fff;
padding: 3px 5px;
text-align: left;
}
.simple th[scope="row"] {
background: inherit;
color: inherit;
border-top: 1px solid #ddd;
}
.simple td {
padding: 3px 10px;
border-top: 1px solid #ddd;
}
.simple tr:nth-child(even) {
background: #f0f6ff;
}
/* --- DL --- */
.section dd > p:first-child {
margin-top: 0;
}
.section dd > p:last-child {
margin-bottom: 0;
}
.section dd {
margin-bottom: 1em;
}
.section dl.attrs dd, .section dl.eldef dd {
margin-bottom: 0;
}
/* --- EXAMPLES --- */
pre.example {
border-top: 1px solid #ff4500;
border-bottom: 1px solid #ff4500;
padding: 1em;
margin-top: 1em;
}
pre.example::before {
content: "Example";
display: block;
width: 150px;
background: #ff4500;
color: #fff;
font-family: initial;
padding: 3px;
font-weight: bold;
margin: -1em 0 1em -1em;
}
/* --- EDITORIAL NOTES --- */
.issue {
padding: 1em;
margin: 1em 0em 0em;
border: 1px solid #f00;
background: #ffc;
}
.issue::before {
content: "Issue";
display: block;
width: 150px;
margin: -1.5em 0 0.5em 0;
font-weight: bold;
border: 1px solid #f00;
background: #fff;
padding: 3px 1em;
}
.note {
margin: 1em 0em 0em;
padding: 1em;
border: 2px solid #cff6d9;
background: #e2fff0;
}
.note::before {
content: "Note";
display: block;
width: 150px;
margin: -1.5em 0 0.5em 0;
font-weight: bold;
border: 1px solid #cff6d9;
background: #fff;
padding: 3px 1em;
}
/* --- Best Practices --- */
div.practice {
border: solid #bebebe 1px;
margin: 2em 1em 1em 2em;
}
span.practicelab {
margin: 1.5em 0.5em 1em 1em;
font-weight: bold;
font-style: italic;
}
span.practicelab { background: #dfffff; }
span.practicelab {
position: relative;
padding: 0 0.5em;
top: -1.5em;
}
p.practicedesc {
margin: 1.5em 0.5em 1em 1em;
}
@media screen {
p.practicedesc {
position: relative;
top: -2em;
padding: 0;
margin: 1.5em 0.5em -1em 1em;
}
}
/* --- SYNTAX HIGHLIGHTING --- */
pre.sh_sourceCode {
background-color: white;
color: black;
font-style: normal;
font-weight: normal;
}
pre.sh_sourceCode .sh_keyword { color: #005a9c; font-weight: bold; } /* language keywords */
pre.sh_sourceCode .sh_type { color: #666; } /* basic types */
pre.sh_sourceCode .sh_usertype { color: teal; } /* user defined types */
pre.sh_sourceCode .sh_string { color: red; font-family: monospace; } /* strings and chars */
pre.sh_sourceCode .sh_regexp { color: orange; font-family: monospace; } /* regular expressions */
pre.sh_sourceCode .sh_specialchar { color: #ffc0cb; font-family: monospace; } /* e.g., \n, \t, \\ */
pre.sh_sourceCode .sh_comment { color: #A52A2A; font-style: italic; } /* comments */
pre.sh_sourceCode .sh_number { color: purple; } /* literal numbers */
pre.sh_sourceCode .sh_preproc { color: #00008B; font-weight: bold; } /* e.g., #include, import */
pre.sh_sourceCode .sh_symbol { color: blue; } /* e.g., *, + */
pre.sh_sourceCode .sh_function { color: black; font-weight: bold; } /* function calls and declarations */
pre.sh_sourceCode .sh_cbracket { color: red; } /* block brackets (e.g., {, }) */
pre.sh_sourceCode .sh_todo { font-weight: bold; background-color: #00FFFF; } /* TODO and FIXME */
/* Predefined variables and functions (for instance glsl) */
pre.sh_sourceCode .sh_predef_var { color: #00008B; }
pre.sh_sourceCode .sh_predef_func { color: #00008B; font-weight: bold; }
/* for OOP */
pre.sh_sourceCode .sh_classname { color: teal; }
/* line numbers (not yet implemented) */
pre.sh_sourceCode .sh_linenum { display: none; }
/* Internet related */
pre.sh_sourceCode .sh_url { color: blue; text-decoration: underline; font-family: monospace; }
/* for ChangeLog and Log files */
pre.sh_sourceCode .sh_date { color: blue; font-weight: bold; }
pre.sh_sourceCode .sh_time, pre.sh_sourceCode .sh_file { color: #00008B; font-weight: bold; }
pre.sh_sourceCode .sh_ip, pre.sh_sourceCode .sh_name { color: #006400; }
/* for Prolog, Perl... */
pre.sh_sourceCode .sh_variable { color: #006400; }
/* for LaTeX */
pre.sh_sourceCode .sh_italics { color: #006400; font-style: italic; }
pre.sh_sourceCode .sh_bold { color: #006400; font-weight: bold; }
pre.sh_sourceCode .sh_underline { color: #006400; text-decoration: underline; }
pre.sh_sourceCode .sh_fixed { color: green; font-family: monospace; }
pre.sh_sourceCode .sh_argument { color: #006400; }
pre.sh_sourceCode .sh_optionalargument { color: purple; }
pre.sh_sourceCode .sh_math { color: orange; }
pre.sh_sourceCode .sh_bibtex { color: blue; }
/* for diffs */
pre.sh_sourceCode .sh_oldfile { color: orange; }
pre.sh_sourceCode .sh_newfile { color: #006400; }
pre.sh_sourceCode .sh_difflines { color: blue; }
/* for css */
pre.sh_sourceCode .sh_selector { color: purple; }
pre.sh_sourceCode .sh_property { color: blue; }
pre.sh_sourceCode .sh_value { color: #006400; font-style: italic; }
/* other */
pre.sh_sourceCode .sh_section { color: black; font-weight: bold; }
pre.sh_sourceCode .sh_paren { color: red; }
pre.sh_sourceCode .sh_attribute { color: #006400; }
</style><link href="http://www.w3.org/StyleSheets/TR/W3C-ED" rel="stylesheet" type="text/css" charset="utf-8" /></head>
<body style="display: inherit;"><div class="head"><p><a href="http://www.w3.org/"><img width="72" height="48" alt="W3C" src="http://www.w3.org/Icons/w3c_home" /></a></p><h1 id="title" class="title">WebRTC 1.0: Real-time Communication Between Browsers</h1><h2 id="w3c-editor-s-draft-16-march-2012"><acronym title="World Wide Web Consortium">W3C</acronym> Editor's Draft 16 March 2012</h2><dl><dt>This version:</dt><dd><a href="http://dev.w3.org/2011/webrtc/editor/webrtc-20120316.html">http://dev.w3.org/2011/webrtc/editor/webrtc-20120316.html</a></dd><dt>Latest published version:</dt><dd><a href="http://www.w3.org/TR/webrtc/">http://www.w3.org/TR/webrtc/</a></dd><dt>Latest editor's draft:</dt><dd><a href="http://dev.w3.org/2011/webrtc/editor/webrtc.html">http://dev.w3.org/2011/webrtc/editor/webrtc.html</a></dd><dt>Previous version:</dt><dd><a href="http://dev.w3.org/2011/webrtc/editor/webrtc-20120128.html">http://dev.w3.org/2011/webrtc/editor/webrtc-20120128.html</a></dd><dt>Editors:</dt><dd><span>Adam Bergkvist</span>, Ericsson</dd>
<dd><span>Daniel C. Burnett</span>, Voxeo</dd>
<dd><span>Cullen Jennings</span>, Cisco</dd>
<dd><span>Anant Narayanan</span>, Mozilla</dd>
</dl><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.</p> <p class="copyright">All subsequent changes since 26 July 2011 done by the <acronym title="World Wide Web Consortium">W3C</acronym> WebRTC Working Group are under the following <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a>:<br />© 2011-2012 <a href="http://www.w3.org/"><acronym title="World Wide Web Consortium">W3C</acronym></a><sup>®</sup> (<a href="http://www.csail.mit.edu/"><acronym title="Massachusetts Institute of Technology">MIT</acronym></a>, <a href="http://www.ercim.eu/"><acronym title="European Research Consortium for Informatics and Mathematics">ERCIM</acronym></a>, <a href="http://www.keio.ac.jp/">Keio</a>), All Rights Reserved. <a href="http://www.w3.org/Consortium/Legal/copyright-documents">Document use</a> rules apply.</p> <p class="copyright">For the entire publication on the <acronym title="World Wide Web Consortium">W3C</acronym> site the <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a> and <a href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a> rules apply.</p><hr /></div>
<div id="abstract" class="introductory section"><h2>Abstract</h2>
<p>This document defines a set of APIs to represent streaming media, including audio
and video, in JavaScript, to allow media to be sent over the network to another browser
or device implementing the appropriate set of real-time protocols, and
media received from another browser or device to be processed
and displayed locally. 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 developed by the Media Capture Task Force.
</p>
</div><div class="introductory section" id="sotd"><h2>Status of This Document</h2><p><em>This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current <acronym title="World Wide Web Consortium">W3C</acronym> publications and the latest revision of this technical report can be found in the <a href="http://www.w3.org/TR/"><acronym title="World Wide Web Consortium">W3C</acronym> technical reports index</a> at http://www.w3.org/TR/.</em></p>
<p>This document is not complete.
It is subject to major changes and, while early experimentations are
encouraged, it is therefore not intended for implementation. The API
is based on preliminary work done in the WHATWG. The Web Real-Time
Communications Working Group expects this specification to evolve
significantly based on:</p>
<ul>
<li>The outcomes of ongoing exchanges in the companion RTCWEB group
at IETF to define the set of protocols that, together with this
document, will enable real-time communications in Web browsers.</li>
<li>Privacy issues that arise when exposing local capabilities and
local streams.</li>
<li>Technical discussions within the group, on the data channel in
particular.</li>
<li>Experience gained through early experimentations.</li>
<li>Feedback received from other groups and individuals.</li>
</ul>
<p>As the specification matures, the group hopes to strike the right
balance between a low-level API that would enable interested parties
to tweak potentially complex system parameters, and a more high-level
API that Web developers can use without <em>a priori</em> technical
knowledge about real-time communications.</p>
<p>This document was published by the <a href="http://www.w3.org/2011/04/webrtc/">Web Real-Time Communications Working Group</a> as an Editor's Draft. If you wish to make comments regarding this document, please send them to <a href="mailto:[email protected]">[email protected]</a> (<a href="mailto:[email protected]?subject=subscribe">subscribe</a>, <a href="http://lists.w3.org/Archives/Public/public-webrtc/">archives</a>). All feedback is welcome.</p><p>Publication as an Editor's Draft does not imply endorsement by the <acronym title="World Wide Web Consortium">W3C</acronym> Membership. This is a draft document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in progress.</p><p>This document was produced by a group operating under the <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/">5 February 2004 <acronym title="World Wide Web Consortium">W3C</acronym> Patent Policy</a>. <acronym title="World Wide Web Consortium">W3C</acronym> maintains a <a rel="disclosure" href="http://www.w3.org/2004/01/pp-impl/47318/status">public list of any patent disclosures</a> made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">Essential Claim(s)</a> must disclose the information in accordance with <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">section 6 of the <acronym title="World Wide Web Consortium">W3C</acronym> Patent Policy</a>.</p></div><div id="toc" class="section"><h2 class="introductory">Table of Contents</h2><ul class="toc"><li class="tocline"><a href="#conformance" class="tocxref"><span class="secno">1. </span>Conformance</a></li><li class="tocline"><a href="#intro" class="tocxref"><span class="secno">2. </span>Introduction</a></li><li class="tocline"><a href="#stream-api" class="tocxref"><span class="secno">3. </span>Stream API</a><ul class="toc"><li class="tocline"><a href="#introduction" class="tocxref"><span class="secno">3.1 </span>Introduction</a></li><li class="tocline"><a href="#interface-definitions" class="tocxref"><span class="secno">3.2 </span>Interface definitions</a><ul class="toc"><li class="tocline"><a href="#mediastream" class="tocxref"><span class="secno">3.2.1 </span>MediaStream</a><ul class="toc"><li class="tocline"><a href="#attributes" class="tocxref"><span class="secno">3.2.1.1 </span>Attributes</a></li><li class="tocline"><a href="#methods" class="tocxref"><span class="secno">3.2.1.2 </span>Methods</a></li></ul></li><li class="tocline"><a href="#localmediastream" class="tocxref"><span class="secno">3.2.2 </span>LocalMediaStream</a><ul class="toc"><li class="tocline"><a href="#methods-1" class="tocxref"><span class="secno">3.2.2.1 </span>Methods</a></li></ul></li><li class="tocline"><a href="#mediastreamtrack" class="tocxref"><span class="secno">3.2.3 </span>MediaStreamTrack</a><ul class="toc"><li class="tocline"><a href="#attributes-1" class="tocxref"><span class="secno">3.2.3.1 </span>Attributes</a></li><li class="tocline"><a href="#constants" class="tocxref"><span class="secno">3.2.3.2 </span>Constants</a></li></ul></li><li class="tocline"><a href="#audiomediastreamtrack" class="tocxref"><span class="secno">3.2.4 </span>AudioMediaStreamTrack</a><ul class="toc"><li class="tocline"><a href="#attributes-2" class="tocxref"><span class="secno">3.2.4.1 </span>Attributes</a></li><li class="tocline"><a href="#methods-2" class="tocxref"><span class="secno">3.2.4.2 </span>Methods</a></li></ul></li><li class="tocline"><a href="#mediastreamtracklist" class="tocxref"><span class="secno">3.2.5 </span>MediaStreamTrackList</a><ul class="toc"><li class="tocline"><a href="#attributes-3" class="tocxref"><span class="secno">3.2.5.1 </span>Attributes</a></li><li class="tocline"><a href="#methods-3" class="tocxref"><span class="secno">3.2.5.2 </span>Methods</a></li></ul></li><li class="tocline"><a href="#mediastreamrecorder" class="tocxref"><span class="secno">3.2.6 </span>MediaStreamRecorder</a><ul class="toc"><li class="tocline"><a href="#methods-4" class="tocxref"><span class="secno">3.2.6.1 </span>Methods</a></li></ul></li><li class="tocline"><a href="#blobcallback" class="tocxref"><span class="secno">3.2.7 </span>BlobCallback</a><ul class="toc"><li class="tocline"><a href="#methods-5" class="tocxref"><span class="secno">3.2.7.1 </span>Methods</a></li></ul></li><li class="tocline"><a href="#url" class="tocxref"><span class="secno">3.2.8 </span>URL</a><ul class="toc"><li class="tocline"><a href="#methods-6" class="tocxref"><span class="secno">3.2.8.1 </span>Methods</a></li></ul></li></ul></li><li class="tocline"><a href="#examples" class="tocxref"><span class="secno">3.3 </span>Examples</a></li></ul></li><li class="tocline"><a href="#peer-to-peer-connections" class="tocxref"><span class="secno">4. </span>Peer-to-peer connections</a><ul class="toc"><li class="tocline"><a href="#peerconnection" class="tocxref"><span class="secno">4.1 </span>PeerConnection</a><ul class="toc"><li class="tocline"><a href="#attributes-4" class="tocxref"><span class="secno">4.1.1 </span>Attributes</a></li><li class="tocline"><a href="#methods-7" class="tocxref"><span class="secno">4.1.2 </span>Methods</a></li><li class="tocline"><a href="#constants-1" class="tocxref"><span class="secno">4.1.3 </span>Constants</a></li></ul></li><li class="tocline"><a href="#signalingcallback" class="tocxref"><span class="secno">4.2 </span>SignalingCallback</a><ul class="toc"><li class="tocline"><a href="#methods-8" class="tocxref"><span class="secno">4.2.1 </span>Methods</a></li></ul></li><li class="tocline"><a href="#examples-1" class="tocxref"><span class="secno">4.3 </span>Examples</a></li></ul></li><li class="tocline"><a href="#peer-to-peer-data-api" class="tocxref"><span class="secno">5. </span>Peer-to-peer Data API</a><ul class="toc"><li class="tocline"><a href="#datachannel" class="tocxref"><span class="secno">5.1 </span>DataChannel</a><ul class="toc"><li class="tocline"><a href="#attributes-5" class="tocxref"><span class="secno">5.1.1 </span>Attributes</a></li><li class="tocline"><a href="#methods-9" class="tocxref"><span class="secno">5.1.2 </span>Methods</a></li><li class="tocline"><a href="#constants-2" class="tocxref"><span class="secno">5.1.3 </span>Constants</a></li><li class="tocline"><a href="#dictionary-datachannelinit-members" class="tocxref"><span class="secno">5.1.4 </span>Dictionary <span class="idlType formerLink idlType"><code>DataChannelInit</code></span> Members</a></li></ul></li><li class="tocline"><a href="#examples-2" class="tocxref"><span class="secno">5.2 </span>Examples</a></li></ul></li><li class="tocline"><a href="#garbage-collection" class="tocxref"><span class="secno">6. </span>Garbage collection</a></li><li class="tocline"><a href="#event-definitions" class="tocxref"><span class="secno">7. </span>Event definitions</a><ul class="toc"><li class="tocline"><a href="#mediastreamtrackevent" class="tocxref"><span class="secno">7.1 </span>MediaStreamTrackEvent</a><ul class="toc"><li class="tocline"><a href="#attributes-6" class="tocxref"><span class="secno">7.1.1 </span>Attributes</a></li><li class="tocline"><a href="#dictionary-mediastreamtrackeventinit-members" class="tocxref"><span class="secno">7.1.2 </span>Dictionary <span class="idlType formerLink idlType"><code>MediaStreamTrackEventInit</code></span> Members</a></li></ul></li><li class="tocline"><a href="#mediastreamevent" class="tocxref"><span class="secno">7.2 </span>MediaStreamEvent</a><ul class="toc"><li class="tocline"><a href="#attributes-7" class="tocxref"><span class="secno">7.2.1 </span>Attributes</a></li><li class="tocline"><a href="#dictionary-mediastreameventinit-members" class="tocxref"><span class="secno">7.2.2 </span>Dictionary <span class="idlType formerLink idlType"><code>MediaStreamEventInit</code></span> Members</a></li></ul></li><li class="tocline"><a href="#datachannelevent" class="tocxref"><span class="secno">7.3 </span>DataChannelEvent</a><ul class="toc"><li class="tocline"><a href="#attributes-8" class="tocxref"><span class="secno">7.3.1 </span>Attributes</a></li><li class="tocline"><a href="#dictionary-datachanneleventinit-members" class="tocxref"><span class="secno">7.3.2 </span>Dictionary <span class="idlType formerLink idlType"><code>DataChannelEventInit</code></span> Members</a></li></ul></li></ul></li><li class="tocline"><a href="#event-summary" class="tocxref"><span class="secno">8. </span>Event summary</a></li><li class="tocline"><a href="#application-html-peer-connection-data" class="tocxref"><span class="secno">9. </span>application/html-peer-connection-data</a></li><li class="tocline"><a href="#change-log" class="tocxref"><span class="secno">10. </span>Change Log</a></li><li class="tocline"><a href="#acknowledgements" class="tocxref"><span class="secno">A. </span>Acknowledgements</a></li><li class="tocline"><a href="#references" class="tocxref"><span class="secno">B. </span>References</a><ul class="toc"><li class="tocline"><a href="#normative-references" class="tocxref"><span class="secno">B.1 </span>Normative references</a></li><li class="tocline"><a href="#informative-references" class="tocxref"><span class="secno">B.2 </span>Informative references</a></li></ul></li></ul></div>
<div id="conformance" class="section">
<!-- OddPage -->
<h2><span class="secno">1. </span>Conformance</h2><p>As well as sections marked as non-normative, all authoring guidelines, diagrams, examples, and notes in this specification are non-normative. Everything else in this specification is normative.</p>
<p>The key words <em class="rfc2119" title="must">must</em>, <em class="rfc2119" title="must not">must not</em>, <em class="rfc2119" title="required">required</em>, <em class="rfc2119" title="should">should</em>, <em class="rfc2119" title="should not">should not</em>, <em class="rfc2119" title="recommended">recommended</em>, <em class="rfc2119" title="may">may</em>, and <em class="rfc2119" title="optional">optional</em> in this specification are to be interpreted as described in [<cite><a class="bibref" rel="biblioentry" href="#bib-RFC2119">RFC2119</a></cite>].</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
[<cite><a class="bibref" rel="biblioentry" href="#bib-WEBIDL">WEBIDL</a></cite>], as this specification uses that specification and terminology.
</p>
</div>
<div class="informative section" id="intro">
<!-- OddPage -->
<h2><span class="secno">2. </span>Introduction</h2><p><em>This section is non-normative.</em></p>
<p>There are a number of facets to video-conferencing in HTML covered by this specification:</p>
<ul>
<li>Representing a multimedia stream (video, audio, or both) from local devices (video
cameras, microphones, Web cams) or from prerecorded files provided by the user.</li>
<li>Recording such streams locally.</li>
<li>Connecting to remote peers using NAT-traversal technologies such as ICE, STUN,
and TURN.</li>
<li>Sending the locally-produced streams to remote peers and receiving streams from
remote peers.</li>
<li>Displaying such streams (both the locally-produced ones and the remotely-obtained
ones) locally using the <code>video</code> or <code>audio</code> elements.</li>
<li>Sending arbitrary data 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="http://datatracker.ietf.org/wg/rtcweb/">IETF RTCWEB group</a> and
an API specification to get access to local media devices developed by the
<a href="http://www.w3.org/2011/04/webrtc/">Media Capture Task Force</a>.</p>
</div>
<div id="stream-api" class="section">
<!-- OddPage -->
<h2><span class="secno">3. </span>Stream API</h2>
<div id="introduction" class="section">
<h3><span class="secno">3.1 </span>Introduction</h3>
<p>The <code><a href="#idl-def-MediaStream" class="idlType"><code>MediaStream</code></a></code> interface is used to
represent streams of media data, typically (but not necessarily) of audio and/or video
content, e.g. from a local camera or a remote site. The data from a <code><a href="#idl-def-MediaStream" class="idlType"><code>MediaStream</code></a></code>
object does not necessarily have a canonical binary form; for example, it could just be
"the video currently coming from the user’s video camera". This allows user agents to manipulate
media streams in whatever fashion is most suitable on the user’s platform.</p>
<p>Each <code><a href="#idl-def-MediaStream" class="idlType"><code>MediaStream</code></a></code> object can contain zero
or more tracks, in particular audio and video tracks.
All tracks in a MediaStream are
intended to be synchronized when rendered.
Different MediaStreams do not need to be synchronized.</p>
<p>Each track in a MediaStream object has a corresponding <code><a href="#idl-def-MediaStreamTrack" class="idlType"><code>MediaStreamTrack</code></a></code> object.</p>
<p>A <code><a href="#idl-def-MediaStreamTrack" class="idlType"><code>MediaStreamTrack</code></a></code> represents content comprising one or more channels, where
the channels have a defined well known relationship to each other (such as a stereo or 5.1 audio signal),
and are intended to be encoded together for transmission as, for instance, an RTP payload type. One
<code><a href="#idl-def-MediaStreamTrack" class="idlType"><code>MediaStreamTrack</code></a></code> sent to another peer <em class="rfc2119" title="must">must</em> appear as one and only one
<code><a href="#idl-def-MediaStreamTrack" class="idlType"><code>MediaStreamTrack</code></a></code> to the recipient. All of the channels
that a codec needs to encode the media <em class="rfc2119" title="must">must</em> be in the same <code><a href="#idl-def-MediaStreamTrack" class="idlType"><code>MediaStreamTrack</code></a></code> and the
codecs <em class="rfc2119" title="should">should</em> be able to encode, or discard, all the channels in the track. </p>
<p>A channel is the smallest unit considered in this API specification.</p>
<p>A <code><a href="#idl-def-MediaStream" class="idlType"><code>MediaStream</code></a></code> object has an input and an
output. The input depends on how the object was created: a <code><a href="#idl-def-LocalMediaStream" class="idlType"><code>LocalMediaStream</code></a></code> object generated by a
<code>getUserMedia()</code> [<cite><a class="bibref" rel="biblioentry" href="#bib-GETUSERMEDIA">GETUSERMEDIA</a></cite>]
call, for instance, might take
its input from the user’s local camera, while a <code><a href="#idl-def-MediaStream" class="idlType"><code>MediaStream</code></a></code> created by a <code><a href="#idl-def-PeerConnection" class="idlType"><code>PeerConnection</code></a></code> object will take as input the data received
from a remote peer. The output of the object controls how the object is used, e.g. what
is saved if the object is written to a file, what is displayed if the object is used in
a <code>video</code> element, or indeed what is transmitted to a remote peer if the
object is used with a <code><a href="#idl-def-PeerConnection" class="idlType"><code>PeerConnection</code></a></code>
object.</p>
<p>Each track in a <code><a href="#idl-def-MediaStream" class="idlType"><code>MediaStream</code></a></code> object can be
disabled, meaning that it is muted in the object’s output. All tracks are initially
enabled.</p>
<p>A <code><a href="#idl-def-MediaStream" class="idlType"><code>MediaStream</code></a></code> can be <a href="#dfn-finished" class="internalDFN">finished</a>, indicating that its inputs have
forever stopped providing data.</p>
<p>The output of a <code><a href="#idl-def-MediaStream" class="idlType"><code>MediaStream</code></a></code> object <em class="rfc2119" title="must">must</em>
correspond to the tracks in its input. Muted audio tracks <em class="rfc2119" title="must">must</em> be replaced with
silence. Muted video tracks <em class="rfc2119" title="must">must</em> be replaced with blackness.</p>
<p>A new <code><a href="#idl-def-MediaStream" class="idlType"><code>MediaStream</code></a></code> object can be created from existing
<code><a href="#idl-def-MediaStreamTrack" class="idlType"><code>MediaStreamTrack</code></a></code> objects using the <code>
<a href="#dom-mediastream">MediaStream()</a></code> constructor. The constructor takes two
lists of <code><a href="#idl-def-MediaStreamTrack" class="idlType"><code>MediaStreamTrack</code></a></code> objects as arguments; one for audio tracks and
one for video tracks. The lists can either be the track lists of another stream, subsets of
such lists, or compositions of <code><a href="#idl-def-MediaStreamTrack" class="idlType"><code>MediaStreamTrack</code></a></code> objects from different
<code><a href="#idl-def-MediaStream" class="idlType"><code>MediaStream</code></a></code> objects. </p>
<p><img src="images/media-stream-1.png" alt="" /></p>
<!-- no alt since
it's all described in the previous paragraphs: this is just a
summary -->
<!--
c.clearRect(0, 0, 640, 480);
c.save();
try {
with (c) {
save();
strokeStyle = '#AA0000';
lineWidth = 20;
beginPath();
moveTo(50,98);
lineTo(550, 98);
stroke();
}
mediaStream(c,50,10, true);
} finally {
c.restore();
}
function cameraIcon(c,x,y) {
with (c) { save(); try {
translate(x,y);
fillRect(-10,-10,20,20);
beginPath();
moveTo(7,0);
lineTo(20,-10);
lineTo(20,10);
fill();
font = '100 8px "Press Start 2P", sans-serif';
textAlign = 'center';
textBaseline = 'top';
fillText('Camera', 4, 15);
} finally { restore(); } }
}
function mediaStream(c,x,y,vid) {
with (c) {
save();
translate(x-10,y-97);
// cable
fillStyle = 'black';
font = '100 10px "Press Start 2P", sans-serif';
textAlign = 'right';
fillText('Input', 95, 170);
textAlign = 'left';
fillText('Output', 407, 170);
// media stream
fillStyle = '#EE8800';
strokeStyle = '#FFCC00';
lineWidth = 6;
fillRect(100,100,300,170);
strokeRect(100,100,300,170);
fillStyle = 'black';
font = '900 12px "Press Start 2P", sans-serif';
textAlign = 'left';
fillText('MediaStream', 110, 123);
// tracks
textAlign = 'left';
strokeStyle = '#CC3300';
fillStyle = '#FFFF00';
lineWidth = 4;
globalAlpha = vid ? 1 : 0.4;
fillRect(120,140,100,110);
strokeRect(120,140,100,110);
globalAlpha = 1;
fillRect(238,140,100,110);
strokeRect(238,140,100,110);
fillStyle = 'black';
font = '900 10px "Press Start 2P", sans-serif';
globalAlpha = vid ? 1 : 0.4;
fillText('Track', 123, 155);
fillText('(video)', 123, 170);
globalAlpha = 1;
fillText('Track', 241, 155);
fillText('(stereo', 241, 170);
fillText(' audio)', 241, 185);
// channels
strokeStyle = '#999999';
fillStyle = '#FFFFFF';
lineWidth = 2;
fillRect(245,191,86,23);
strokeRect(245,191,86,23);
fillRect(245,220,86,23);
strokeRect(245,220,86,23);
fillStyle = 'black';
font = '100 8px "Press Start 2P", sans-serif';
textAlign = 'left';
textBaseline = 'alphabetic';
fillText('left', 249, 202);
fillText('channel', 249, 211);
fillText('right', 249, 231);
fillText('channel', 249, 240);
// track check marks
fillStyle = 'black';
font = '900 35px "Lucida Grande", sans-serif';
textAlign = 'center';
textBaseline = 'middle';
fillText(vid ? '\u2713' : '\u2716', 220, 245);
fillText('\u2713', 338, 245);
restore();
}
}
-->
<p>The ability to duplicate a <code><a href="#idl-def-MediaStream" class="idlType"><code>MediaStream</code></a></code>, i.e.
create a new <code><a href="#idl-def-MediaStream" class="idlType"><code>MediaStream</code></a></code> object from the track lists of an existing stream,
allows for greater control since separate <code><a href="#idl-def-MediaStream" class="idlType"><code>MediaStream</code></a></code> instances can be
manipulated and <a title="consumer" href="#dfn-consumer" class="internalDFN">consumed</a>
individually. This can be used, for instance, in a video-conferencing scenario to display
the local video from the user’s camera and microphone in a local monitor, while only
transmitting the audio to the remote peer (e.g. in response to the user using a "video
mute" feature). Combining tracks from different <code><a href="#idl-def-MediaStream" class="idlType"><code>MediaStream</code></a>
</code> objects into a new <code><a href="#idl-def-MediaStream" class="idlType"><code>MediaStream</code></a></code> makes it
possible to, e.g., record selected tracks from a conversation involving several <code>
<a href="#mediastream">MediaStream</a></code> objects with a single <code>
<a href="#mediastreamrecorder">MediaStreamRecorder</a></code>.</p>
<!--
c.clearRect(0, 0, 640, 480);
c.save();
try {
with (c) {
save();
strokeStyle = '#AA0000';
lineWidth = 20;
beginPath();
moveTo(50,98);
lineTo(550, 98);
lineTo(550, 210);
lineTo(50, 210);
lineTo(50, 320);
lineTo(550, 320);
lineTo(550,420);
stroke();
beginPath();
moveTo(50,320);
lineTo(50,420);
stroke();
restore();
fillStyle = 'black';
font = '100 10px "Press Start 2P", sans-serif';
textAlign = 'center';
fillText('<video>', 50, 440);
fillText('PeerConnection', 550, 440);
font = '100 8px "Press Start 2P", sans-serif';
}
cameraIcon(c,25,98)
mediaStream(c,50,10, true);
mediaStream(c,50,233, false);
with (c) {
font = '100 8px "Press Start 2P", sans-serif';
textAlign = 'left';
textBaseline = 'middle';
fillStyle = 'gray';
fillText('from', 4, 130);
fillText('getUserMedia()', 4, 140);
fillText('via URL.createObjectURL()', 4, 450);
textAlign = 'center';
fillText('via addStream()', 550, 450);
}
} finally {
c.restore();
}
function cameraIcon(c,x,y) {
with (c) { save(); try {
translate(x,y);
fillRect(-10,-10,20,20);
beginPath();
moveTo(7,0);
lineTo(20,-10);
lineTo(20,10);
fill();
font = '100 8px "Press Start 2P", sans-serif';
textAlign = 'center';
textBaseline = 'top';
fillText('Camera', 4, 15);
} finally { restore(); } }
}
function mediaStream(c,x,y,vid) {
with (c) {
save();
translate(x-10,y-97);
// cable
fillStyle = 'black';
font = '100 10px "Press Start 2P", sans-serif';
textAlign = 'right';
fillText('Input', 95, 170);
textAlign = 'left';
fillText('Output', 407, 170);
// media stream
fillStyle = '#EE8800';
strokeStyle = '#FFCC00';
lineWidth = 6;
fillRect(100,100,300,170);
strokeRect(100,100,300,170);
fillStyle = 'black';
font = '900 12px "Press Start 2P", sans-serif';
textAlign = 'left';
fillText(!vid ? 'MediaStream' : 'LocalMediaStream', 110, 123);
// tracks
textAlign = 'left';
strokeStyle = '#CC3300';
fillStyle = '#FFFF00';
lineWidth = 4;
globalAlpha = vid ? 1 : 0.4;
fillRect(120,140,100,110);
strokeRect(120,140,100,110);
globalAlpha = 1;
fillRect(238,140,100,110);
strokeRect(238,140,100,110);
fillStyle = 'black';
font = '900 10px "Press Start 2P", sans-serif';
globalAlpha = vid ? 1 : 0.4;
fillText('Track', 123, 155);
fillText('(video)', 123, 170);
globalAlpha = 1;
fillText('Track', 241, 155);
fillText('(stereo', 241, 170);
fillText(' audio)', 241, 185);
// channels
strokeStyle = '#999999';
fillStyle = '#FFFFFF';
lineWidth = 2;
fillRect(245,191,86,23);
strokeRect(245,191,86,23);
fillRect(245,220,86,23);
strokeRect(245,220,86,23);
fillStyle = 'black';
font = '100 8px "Press Start 2P", sans-serif';
textAlign = 'left';
textBaseline = 'alphabetic';
fillText('left', 249, 202);
fillText('channel', 249, 211);
fillText('right', 249, 231);
fillText('channel', 249, 240);
// track check marks
fillStyle = 'black';
font = '900 35px "Lucida Grande", sans-serif';
textAlign = 'center';
textBaseline = 'middle';
fillText(vid ? '\u2713' : '\u2716', 220, 245);
fillText('\u2713', 338, 245);
restore();
}
}
-->
<p>The <code><a href="#idl-def-LocalMediaStream" class="idlType"><code>LocalMediaStream</code></a></code> interface is used
when the user agent is generating the stream’s data (e.g. from a camera or streaming it
from a local video file).</p>
<p>When a <code><a href="#idl-def-LocalMediaStream" class="idlType"><code>LocalMediaStream</code></a></code> object is being
generated from a local file (as opposed to a live audio/video source), the user agent
<em class="rfc2119" title="should">should</em> stream the data from the file in real time, not all at once. This reduces the
ease with which pages can distinguish live video from pre-recorded video, which can
help protect the user’s privacy.</p>
</div>
<div id="interface-definitions" class="section">
<h3><span class="secno">3.2 </span>Interface definitions</h3>
<div id="mediastream" class="section">
<h4><span class="secno">3.2.1 </span>MediaStream</h4>
<p>The <dfn id="dom-mediastream"><code>MediaStream()</code></dfn>
constructor takes two arguments. The arguments are two lists with <code><a href="#idl-def-MediaStreamTrack" class="idlType"><code>MediaStreamTrack</code></a>
</code> objects which will be used to construct the audio and video track lists of the new
<code><a href="#idl-def-MediaStream" class="idlType"><code>MediaStream</code></a></code> object. When the constructor is invoked, the UA must run the
following steps:</p>
<ol>
<li>
<p>Let <var>audioTracks</var> be the constructor’s first argument.</p>
</li>
<li>
<p>Let <var>videoTracks</var> be the constructor’s second argument.</p>
</li>
<li>
<p>Let <var>stream</var> be a newly constructed <code><a href="#idl-def-MediaStream" class="idlType"><code>MediaStream</code></a></code> object.</p>
</li>
<li>
<p>Set <var>stream’s</var> label attribute to a newly generated value.</p>
</li>
<li>
<p>If <var>audioTracks</var> is not null, then run the following sub steps for each element
<var>track</var> in <var>audioTracks</var>:</p>
<ol>
<li>
<p>If <var>track</var> is of any other kind than "<code>audio</code>", then throw
a <code>SyntaxError</code> exception.</p>
</li>