forked from w3c/encrypted-media
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
5152 lines (4802 loc) · 555 KB
/
index.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"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta name="generator" content="ReSpec 25.6.0"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><style>span.example-title{text-transform:none}aside.example,div.example,div.illegal-example{padding:.5em;margin:1em 0;position:relative;clear:both}div.illegal-example{color:red}div.illegal-example p{color:#000}aside.example,div.example{padding:.5em;border-left-width:.5em;border-left-style:solid;border-color:#e0cb52;background:#fcfaee}aside.example div.example{border-left-width:.1em;border-color:#999;background:#fff}aside.example div.example span.example-title{color:#999}</style><style>.issue-label{text-transform:initial}.warning>p:first-child{margin-top:0}.warning{padding:.5em;border-left-width:.5em;border-left-style:solid}span.warning{padding:.1em .5em .15em}.issue.closed span.issue-number{text-decoration:line-through}.warning{border-color:#f11;border-width:.2em;border-style:solid;background:#fbe9e9}.warning-title:before{content:"⚠";font-size:1.3em;float:left;padding-right:.3em;margin-top:-.3em}li.task-list-item{list-style:none}input.task-list-item-checkbox{margin:0 .35em .25em -1.6em;vertical-align:middle}.issue a.respec-gh-label{padding:5px;margin:0 2px 0 2px;font-size:10px;text-transform:none;text-decoration:none;font-weight:700;border-radius:4px;position:relative;bottom:2px;border:none;display:inline-block}</style><style>pre.idl{padding:1em;position:relative}@media print{pre.idl{white-space:pre-wrap}}.idlHeader{display:block;width:150px;background:#8ccbf2;color:#fff;font-family:sans-serif;font-weight:700;margin:-1em 0 1em -1em;height:28px;line-height:28px}.idlHeader a.self-link{margin-left:.3cm;text-decoration:none;border-bottom:none}.idlID{font-weight:700;color:#005a9c}.idlType{color:#005a9c}.idlName{color:#ff4500}.idlName a{color:#ff4500;border-bottom:1px dotted #ff4500;text-decoration:none}a.idlEnumItem{color:#000;border-bottom:1px dotted #ccc;text-decoration:none}.idlSuperclass{font-style:italic;color:#005a9c}.idlDefaultValue,.idlParamName{font-style:italic}.extAttr{color:#666}.idlSectionComment{color:gray}.idlIncludes a{font-weight:700}.respec-button-copy-paste:focus{text-decoration:none;border-color:#51a7e8;outline:0;box-shadow:0 0 5px rgba(81,167,232,.5)}.respec-button-copy-paste.selected:focus,.respec-button-copy-paste:focus:hover{border-color:#51a7e8}.respec-button-copy-paste.zeroclipboard-is-active,.respec-button-copy-paste.zeroclipboard-is-hover,.respec-button-copy-paste:active,.respec-button-copy-paste:hover{text-decoration:none;background-color:#ddd;background-image:linear-gradient(#eee,#ddd);border-color:#ccc}.respec-button-copy-paste.selected,.respec-button-copy-paste.zeroclipboard-is-active,.respec-button-copy-paste:active{background-color:#dcdcdc;background-image:none;border-color:#b5b5b5;box-shadow:inset 0 2px 4px rgba(0,0,0,.15)}.respec-button-copy-paste.selected:hover{background-color:#cfcfcf}.respec-button-copy-paste.disabled,.respec-button-copy-paste.disabled:hover,.respec-button-copy-paste:disabled,.respec-button-copy-paste:disabled:hover{color:rgba(102,102,102,.5);cursor:default;background-color:rgba(229,229,229,.5);background-image:none;border-color:rgba(197,197,197,.5);box-shadow:none}@media print{.respec-button-copy-paste{visibility:hidden}}</style>
<title>Encrypted Media Extensions</title>
<style id="respec-mainstyle">@keyframes pop{0%{transform:scale(1,1)}25%{transform:scale(1.25,1.25);opacity:.75}100%{transform:scale(1,1)}}.hljs{background:0 0!important}a abbr,h1 abbr,h2 abbr,h3 abbr,h4 abbr,h5 abbr,h6 abbr{border:none}dfn{font-weight:700}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}.respec-offending-element:target{animation:pop .25s ease-in-out 0s 1}.respec-offending-element,a[href].respec-offending-element{text-decoration:red wavy underline}@supports not (text-decoration:red wavy underline){.respec-offending-element:not(pre){display:inline-block}.respec-offending-element{background:url(data:image/gif;base64,R0lGODdhBAADAPEAANv///8AAP///wAAACwAAAAABAADAEACBZQjmIAFADs=) bottom repeat-x}}#references :target{background:#eaf3ff;animation:pop .4s ease-in-out 0s 1}cite .bibref{font-style:normal}code{color:#c63501}th code{color:inherit}a[href].orcid{padding-left:4px;padding-right:4px}a[href].orcid>svg{margin-bottom:-2px}.toc a,.tof a{text-decoration:none}a .figno,a .secno{color:#000}ol.tof,ul.tof{list-style:none outside none}.caption{margin-top:.5em;font-style:italic}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 a{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}.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}#issue-summary>ul,.respec-dfn-list{column-count:2}#issue-summary li,.respec-dfn-list li{list-style:none}details.respec-tests-details{margin-left:1em;display:inline-block;vertical-align:top}details.respec-tests-details>*{padding-right:2em}details.respec-tests-details[open]{z-index:999999;position:absolute;border:thin solid #cad3e2;border-radius:.3em;background-color:#fff;padding-bottom:.5em}details.respec-tests-details[open]>summary{border-bottom:thin solid #cad3e2;padding-left:1em;margin-bottom:1em;line-height:2em}details.respec-tests-details>ul{width:100%;margin-top:-.3em}details.respec-tests-details>li{padding-left:1em}a[href].self-link:hover{opacity:1;text-decoration:none;background-color:transparent}h2,h3,h4,h5,h6{position:relative}aside.example .marker>a.self-link{color:inherit}h2>a.self-link,h3>a.self-link,h4>a.self-link,h5>a.self-link,h6>a.self-link{border:none;color:inherit;font-size:83%;height:2em;left:-1.6em;opacity:.5;position:absolute;text-align:center;text-decoration:none;top:0;transition:opacity .2s;width:2em}h2>a.self-link::before,h3>a.self-link::before,h4>a.self-link::before,h5>a.self-link::before,h6>a.self-link::before{content:"§";display:block}@media (max-width:767px){dd{margin-left:0}h2>a.self-link,h3>a.self-link,h4>a.self-link,h5>a.self-link,h6>a.self-link{left:auto;top:auto}}@media print{.removeOnSave{display:none}}</style>
<link rel="stylesheet" href="eme.css">
<meta name="description" content="This proposal extends [HTML] providing APIs to control playback of encrypted content."><link rel="canonical" href="https://www.w3.org/TR/encrypted-media/"><style>.hljs{display:block;overflow-x:auto;padding:.5em;color:#383a42;background:#fafafa}.hljs-comment,.hljs-quote{color:#717277;font-style:italic}.hljs-doctag,.hljs-formula,.hljs-keyword{color:#a626a4}.hljs-deletion,.hljs-name,.hljs-section,.hljs-selector-tag,.hljs-subst{color:#ca4706;font-weight:700}.hljs-literal{color:#0b76c5}.hljs-addition,.hljs-attribute,.hljs-meta-string,.hljs-regexp,.hljs-string{color:#42803c}.hljs-built_in,.hljs-class .hljs-title{color:#9a6a01}.hljs-attr,.hljs-number,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-pseudo,.hljs-template-variable,.hljs-type,.hljs-variable{color:#986801}.hljs-bullet,.hljs-link,.hljs-meta,.hljs-selector-id,.hljs-symbol,.hljs-title{color:#336ae3}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}.hljs-link{text-decoration:underline}</style><style>var{position:relative;cursor:pointer}var[data-type]::after,var[data-type]::before{position:absolute;left:50%;top:-6px;opacity:0;transition:opacity .4s;pointer-events:none}var[data-type]::before{content:"";transform:translateX(-50%);border-width:4px 6px 0 6px;border-style:solid;border-color:transparent;border-top-color:#000}var[data-type]::after{content:attr(data-type);transform:translateX(-50%) translateY(-100%);background:#000;text-align:center;font-family:"Dank Mono","Fira Code",monospace;font-style:normal;padding:6px;border-radius:3px;color:#daca88;text-indent:0;font-weight:400}var[data-type]:hover::after,var[data-type]:hover::before{opacity:1}</style><script id="initialUserConfig" type="application/json">{
"specStatus": "ED",
"implementationReportURI": "https://w3c.github.io/test-results/encrypted-media/all.html",
"shortName": "encrypted-media",
"license": "w3c-software-doc",
"useExperimentalStyles": true,
"edDraftURI": "https://w3c.github.io/encrypted-media/",
"editors": [
{
"name": "Joey Parrish",
"w3cid": "105371",
"company": "Google Inc.",
"companyURL": "https://www.google.com/"
},
{
"name": "Greg Freedman",
"company": "Netflix Inc.",
"companyURL": "https://www.netflix.com/"
}
],
"formerEditors": [
{
"name": "Mark Watson",
"note": "Until September 2019",
"w3cid": "46379",
"company": "Netflix Inc.",
"companyURL": "https://www.netflix.com/"
},
{
"name": "David Dorwin",
"note": "Until September 2017",
"w3cid": "52505",
"company": "Google Inc.",
"companyURL": "https://www.google.com/"
},
{
"name": "Jerry Smith",
"note": "Until September 2017",
"w3cid": "60176",
"company": "Microsoft Corporation",
"companyURL": "https://www.microsoft.com/"
},
{
"name": "Adrian Bateman",
"note": "Until May 2014",
"w3cid": "42763",
"company": "Microsoft Corporation",
"companyURL": "https://www.microsoft.com/"
}
],
"emeDefGroupName": "encrypted-media",
"emeContributors": [
"Aaron Colwell",
"Alex Russell",
"Anne van Kesteren",
"Bob Lund",
"Boris Zbarsky",
"Chris Pearce",
"David Singer",
"Domenic Denicola",
"Frank Galligan",
"Glenn Adams",
"Henri Sivonen",
"Jer Noble",
"Joe Steele",
"Joey Parrish",
"John Simmons",
"Mark Vickers",
"Pavel Pergamenshchik",
"Philip Jägenstedt",
"Pierre Lemieux",
"Robert O'Callahan",
"Ryan Sleevi",
"Steve Heffernan",
"Steven Robertson",
"Theresa O'Connor",
"Thomás Inskip",
"Travis Leithead",
"Xiaohan Wang"
],
"otherLinks": [
{
"key": "Repository",
"data": [
{
"value": "We are on GitHub.",
"href": "https://github.com/w3c/encrypted-media/"
},
{
"value": "File a bug.",
"href": "https://github.com/w3c/encrypted-media/issues"
},
{
"value": "Commit history.",
"href": "https://github.com/w3c/encrypted-media/commits/gh-pages/encrypted-media-respec.html"
}
]
}
],
"emeUnusedGroupNameExcludeList": [
"eme-references-from-registry"
],
"wg": "Media Working Group",
"wgURI": "https://www.w3.org/media-wg/",
"wgPublicList": "public-media-wg",
"wgPatentURI": "https://www.w3.org/2004/01/pp-impl/115198/status",
"noIDLIn": true,
"scheme": "https",
"preProcess": [
null
],
"definitionMap": {},
"postProcess": [
null
],
"localBiblio": {
"CENC": {
"title": "ISO/IEC 23001-7:2016, Information technology — MPEG systems technologies — Part 7: Common encryption in ISO Base Media File Format files",
"href": "https://www.iso.org/obp/ui/#iso:std:iso-iec:23001:-7:ed-3:v1",
"status": "International Standard",
"publisher": "ISO/IEC",
"id": "cenc"
},
"EME-INITDATA-REGISTRY": {
"title": "Encrypted Media Extensions Initialization Data Format Registry",
"href": "format-registry/initdata/index.html",
"authors": [
"David Dorwin",
"Adrian Bateman",
"Mark Watson"
],
"publisher": "W3C",
"id": "eme-initdata-registry"
},
"EME-INITDATA-CENC": {
"title": "\"cenc\" Initialization Data Format",
"href": "format-registry/initdata/cenc.html",
"authors": [
"David Dorwin",
"Adrian Bateman",
"Mark Watson",
"Jerry Smith"
],
"publisher": "W3C"
},
"EME-INITDATA-WEBM": {
"title": "\"webm\" Initialization Data Format",
"href": "format-registry/initdata/webm.html",
"authors": [
"David Dorwin",
"Adrian Bateman",
"Mark Watson",
"Jerry Smith"
],
"publisher": "W3C"
},
"EME-INITDATA-KEYIDS": {
"title": "\"keyids\" Initialization Data Format",
"href": "format-registry/initdata/keyids.html",
"authors": [
"David Dorwin",
"Adrian Bateman",
"Mark Watson",
"Jerry Smith"
],
"publisher": "W3C",
"id": "eme-initdata-keyids"
},
"EME-STREAM-REGISTRY": {
"title": "Encrypted Media Extensions Stream Format Registry",
"href": "format-registry/stream/index.html",
"authors": [
"David Dorwin",
"Adrian Bateman",
"Mark Watson"
],
"publisher": "W3C",
"id": "eme-stream-registry"
},
"EME-STREAM-MP4": {
"title": "ISO Common Encryption ('cenc') Protection Scheme for ISO Base Media File Format Stream Format",
"href": "format-registry/stream/mp4.html",
"authors": [
"David Dorwin",
"Adrian Bateman",
"Mark Watson",
"Jerry Smith"
],
"publisher": "W3C"
},
"EME-STREAM-WEBM": {
"title": "WebM Stream Format",
"href": "format-registry/stream/webm.html",
"authors": [
"David Dorwin",
"Adrian Bateman",
"Mark Watson"
],
"publisher": "W3C"
}
},
"publishISODate": "2020-09-09T00:00:00.000Z",
"generatedSubtitle": "Editor's Draft 09 September 2020"
}</script><link rel="stylesheet" href="https://www.w3.org/StyleSheets/TR/2016/W3C-ED"></head>
<body data-cite="WebIDL HTML" class="h-entry"><div class="head">
<a class="logo" href="https://www.w3.org/"><img alt="W3C" width="72" height="48" src="https://www.w3.org/StyleSheets/TR/2016/logos/W3C"></a> <h1 id="title" class="title">Encrypted Media Extensions</h1>
<h2>
W3C Editor's Draft
<time class="dt-published" datetime="2020-09-09">09 September 2020</time>
</h2>
<dl>
<dt>This version:</dt><dd>
<a class="u-url" href="https://w3c.github.io/encrypted-media/">https://w3c.github.io/encrypted-media/</a>
</dd><dt>Latest published version:</dt><dd>
<a href="https://www.w3.org/TR/encrypted-media/">https://www.w3.org/TR/encrypted-media/</a>
</dd>
<dt>Latest editor's draft:</dt><dd><a href="https://w3c.github.io/encrypted-media/">https://w3c.github.io/encrypted-media/</a></dd>
<dt>Implementation report:</dt><dd>
<a href="https://w3c.github.io/test-results/encrypted-media/all.html">https://w3c.github.io/test-results/encrypted-media/all.html</a>
</dd>
<dt>Editors:</dt>
<dd class="p-author h-card vcard" data-editor-id="105371"><span class="p-name fn">Joey Parrish</span>
(<a class="p-org org h-org h-card" href="https://www.google.com/">Google Inc.</a>)
</dd><dd class="p-author h-card vcard"><span class="p-name fn">Greg Freedman</span>
(<a class="p-org org h-org h-card" href="https://www.netflix.com/">Netflix Inc.</a>)
</dd>
<dt>
Former editors:
</dt><dd class="p-author h-card vcard" data-editor-id="46379"><span class="p-name fn">Mark Watson</span>
(<a class="p-org org h-org h-card" href="https://www.netflix.com/">Netflix Inc.</a>)
(Until September 2019)</dd><dd class="p-author h-card vcard" data-editor-id="52505"><span class="p-name fn">David Dorwin</span>
(<a class="p-org org h-org h-card" href="https://www.google.com/">Google Inc.</a>)
(Until September 2017)</dd><dd class="p-author h-card vcard" data-editor-id="60176"><span class="p-name fn">Jerry Smith</span>
(<a class="p-org org h-org h-card" href="https://www.microsoft.com/">Microsoft Corporation</a>)
(Until September 2017)</dd><dd class="p-author h-card vcard" data-editor-id="42763"><span class="p-name fn">Adrian Bateman</span>
(<a class="p-org org h-org h-card" href="https://www.microsoft.com/">Microsoft Corporation</a>)
(Until May 2014)</dd>
<dt>Repository:</dt><dd>
<a href="https://github.com/w3c/encrypted-media/">We are on GitHub.</a>
</dd><dd>
<a href="https://github.com/w3c/encrypted-media/issues">File a bug.</a>
</dd><dd>
<a href="https://github.com/w3c/encrypted-media/commits/gh-pages/encrypted-media-respec.html">Commit history.</a>
</dd>
</dl>
<p class="copyright">
<a href="https://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a>
©
2020
<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>).
W3C <a href="https://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>,
<a href="https://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a> and <a rel="license" href="https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document">permissive document license</a> rules
apply.
</p>
<hr title="Separator for header">
</div>
<section id="abstract" class="introductory"><h2>Abstract</h2>
<p>This proposal extends <code><a href="https://www.w3.org/TR/html51/semantics-embedded-content.html#htmlmediaelement-htmlmediaelement">HTMLMediaElement</a></code> [<cite><a class="bibref" data-link-type="biblio" href="#bib-html" title="HTML Standard">HTML</a></cite>] providing APIs to control playback of encrypted content.</p>
<p>The API supports use cases ranging from simple clear key decryption to high value video (given an appropriate user agent implementation).
License/key exchange is controlled by the application, facilitating the development of robust playback applications supporting a range of content decryption and protection technologies.</p>
<p>This specification does not define a content protection or Digital Rights Management system. Rather, it defines a common API that may be used to discover, select and interact with
such systems as well as with simpler content encryption systems. Implementation of Digital Rights Management is not required for compliance with this specification: only the
Clear Key system is required to be implemented as a common baseline.</p>
<p>The common API supports a simple set of content encryption capabilities, leaving application functions such as authentication and authorization to page authors. This is achieved by
requiring content protection system-specific messaging to be mediated by the page rather than assuming out-of-band communication between the encryption system and a license
or other server.</p>
</section>
<section id="sotd" class="introductory"><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 <abbr title="World Wide Web Consortium">W3C</abbr> publications and the latest revision
of this technical report can be found in the
<a href="https://www.w3.org/TR/"><abbr title="World Wide Web Consortium">W3C</abbr> technical reports index</a> at
https://www.w3.org/TR/.</em></p>
<p>
This document was published by the <a href="https://www.w3.org/media-wg/">Media Working Group</a> as an
Editor's Draft.
</p><p>
Comments regarding this document are welcome.
Please send them to
<a href="mailto:public-media-wg@w3.org">public-media-wg@w3.org</a>
(<a href="https://lists.w3.org/Archives/Public/public-media-wg/">archives</a>).
</p><p>
Please see the Working Group's
<a href="https://w3c.github.io/test-results/encrypted-media/all.html">implementation report</a>.
</p><p>
Publication as an Editor's Draft does not imply endorsement by the <abbr title="World Wide Web Consortium">W3C</abbr>
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="https://www.w3.org/Consortium/Patent-Policy/"><abbr title="World Wide Web Consortium">W3C</abbr> Patent Policy</a>.
<abbr title="World Wide Web Consortium">W3C</abbr> maintains a
<a rel="disclosure" href="https://www.w3.org/2004/01/pp-impl/115198/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="https://www.w3.org/Consortium/Patent-Policy/#def-essential">Essential Claim(s)</a>
must disclose the information in accordance with
<a href="https://www.w3.org/Consortium/Patent-Policy/#sec-Disclosure">section 6 of the <abbr title="World Wide Web Consortium">W3C</abbr> Patent Policy</a>.
</p><p>
This document is governed by the
<a id="w3c_process_revision" href="https://www.w3.org/2019/Process-20190301/">1 March 2019 <abbr title="World Wide Web Consortium">W3C</abbr> Process Document</a>.
</p></section><nav id="toc"><h2 class="introductory" id="table-of-contents">Table of Contents</h2><ol class="toc"><li class="tocline"><a class="tocxref" href="#introduction"><bdi class="secno">1. </bdi>Introduction</a></li><li class="tocline"><a class="tocxref" href="#definitions"><bdi class="secno">2. </bdi>Definitions</a></li><li class="tocline"><a class="tocxref" href="#obtaining-access-to-key-systems"><bdi class="secno">3. </bdi>Obtaining Access to Key Systems</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#feature-policy-integration"><bdi class="secno">3.1 </bdi>Feature Policy Integration</a></li><li class="tocline"><a class="tocxref" href="#navigator-extension-requestmediakeysystemaccess"><bdi class="secno">3.2 </bdi><span data-dfn-type="dfn" data-idl="interface" data-title="Navigator" data-dfn-for=""><code>Navigator</code></span> Extension: <code>requestMediaKeySystemAccess()</code></a><ol class="toc"><li class="tocline"><a class="tocxref" href="#algorithms"><bdi class="secno">3.2.1 </bdi>Algorithms</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#get-supported-configuration"><bdi class="secno">3.2.1.1 </bdi>Get Supported Configuration</a></li><li class="tocline"><a class="tocxref" href="#get-supported-configuration-and-consent"><bdi class="secno">3.2.1.2 </bdi>Get Supported Configuration and Consent</a></li><li class="tocline"><a class="tocxref" href="#get-supported-capabilities-for-audio-video-type"><bdi class="secno">3.2.1.3 </bdi>Get Supported Capabilities for Audio/Video Type</a></li><li class="tocline"><a class="tocxref" href="#get-consent-status"><bdi class="secno">3.2.1.4 </bdi>Get Consent Status</a></li></ol></li></ol></li><li class="tocline"><a class="tocxref" href="#mediakeysystemconfiguration-dictionary"><bdi class="secno">3.3 </bdi><span class="formerLink" data-link-type="idl"><code>MediaKeySystemConfiguration</code></span> dictionary</a></li><li class="tocline"><a class="tocxref" href="#mediakeysystemmediacapability-dictionary"><bdi class="secno">3.4 </bdi><span data-dfn-type="dictionary" data-export="" data-idl="dictionary" data-title="MediaKeySystemMediaCapability" data-dfn-for=""><code>MediaKeySystemMediaCapability</code></span> dictionary</a></li></ol></li><li class="tocline"><a class="tocxref" href="#mediakeysystemaccess-interface"><bdi class="secno">4. </bdi><span data-dfn-type="interface" data-export="" data-idl="interface" data-title="MediaKeySystemAccess" data-dfn-for=""><code>MediaKeySystemAccess</code></span> Interface</a></li><li class="tocline"><a class="tocxref" href="#mediakeys-interface"><bdi class="secno">5. </bdi><span data-dfn-type="interface" data-export="" data-idl="interface" data-title="MediaKeys" data-dfn-for=""><code>MediaKeys</code></span> Interface</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#algorithms-0"><bdi class="secno">5.1 </bdi>Algorithms</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#is-persistent-session-type"><bdi class="secno">5.1.1 </bdi>Is persistent session type?</a></li><li class="tocline"><a class="tocxref" href="#cdm-unavailable"><bdi class="secno">5.1.2 </bdi>CDM Unavailable</a></li></ol></li><li class="tocline"><a class="tocxref" href="#media-keys-storage"><bdi class="secno">5.2 </bdi>Storage and Persistence</a></li></ol></li><li class="tocline"><a class="tocxref" href="#mediakeysession-interface"><bdi class="secno">6. </bdi><span data-dfn-type="interface" data-export="" data-idl="interface" data-title="MediaKeySession" data-dfn-for=""><code>MediaKeySession</code></span> Interface</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#mediakeystatusmap-interface"><bdi class="secno">6.1 </bdi><span data-dfn-type="interface" data-export="" data-idl="interface" data-title="MediaKeyStatusMap" data-dfn-for=""><code>MediaKeyStatusMap</code></span> Interface</a></li><li class="tocline"><a class="tocxref" href="#mediakeymessageevent"><bdi class="secno">6.2 </bdi><span class="formerLink" data-link-type="idl"><code>MediaKeyMessageEvent</code></span></a><ol class="toc"><li class="tocline"><a class="tocxref" href="#mediakeymessageeventinit"><bdi class="secno">6.2.1 </bdi><span data-dfn-type="dictionary" data-export="" data-idl="dictionary" data-title="MediaKeyMessageEventInit" data-dfn-for=""><code>MediaKeyMessageEventInit</code></span></a></li></ol></li><li class="tocline"><a class="tocxref" href="#mediakeysession-events"><bdi class="secno">6.3 </bdi>Event Summary</a></li><li class="tocline"><a class="tocxref" href="#mediakeysession-algorithms"><bdi class="secno">6.4 </bdi>Algorithms</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#queue-message"><bdi class="secno">6.4.1 </bdi>Queue a "message" Event</a></li><li class="tocline"><a class="tocxref" href="#update-key-statuses"><bdi class="secno">6.4.2 </bdi>Update Key Statuses</a></li><li class="tocline"><a class="tocxref" href="#update-expiration"><bdi class="secno">6.4.3 </bdi>Update Expiration</a></li><li class="tocline"><a class="tocxref" href="#session-closed"><bdi class="secno">6.4.4 </bdi>Session Closed</a></li><li class="tocline"><a class="tocxref" href="#media-key-session-destroyed"><bdi class="secno">6.4.5 </bdi>MediaKeySession Destroyed</a></li><li class="tocline"><a class="tocxref" href="#monitor-cdm"><bdi class="secno">6.4.6 </bdi>Monitor for CDM State Changes</a></li></ol></li><li class="tocline"><a class="tocxref" href="#exceptions"><bdi class="secno">6.5 </bdi>Exceptions</a></li><li class="tocline"><a class="tocxref" href="#session-storage"><bdi class="secno">6.6 </bdi>Session Storage and Persistence</a></li></ol></li><li class="tocline"><a class="tocxref" href="#htmlmediaelement-extensions"><bdi class="secno">7. </bdi><span data-dfn-type="dfn" data-idl="interface" data-title="HTMLMediaElement" data-dfn-for=""><code>HTMLMediaElement</code></span> Extensions</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#mediaencryptedevent"><bdi class="secno">7.1 </bdi><span class="formerLink" data-link-type="idl"><code>MediaEncryptedEvent</code></span></a><ol class="toc"><li class="tocline"><a class="tocxref" href="#mediaencryptedeventinit"><bdi class="secno">7.1.1 </bdi><span data-dfn-type="dictionary" data-export="" data-idl="dictionary" data-title="MediaEncryptedEventInit" data-dfn-for=""><code>MediaEncryptedEventInit</code></span></a></li></ol></li><li class="tocline"><a class="tocxref" href="#htmlmediaelement-events"><bdi class="secno">7.2 </bdi>Event Summary</a></li><li class="tocline"><a class="tocxref" href="#htmlmediaelement-algorithms"><bdi class="secno">7.3 </bdi>Algorithms</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#media-may-contain-encrypted-blocks"><bdi class="secno">7.3.1 </bdi>Media Data May Contain Encrypted Blocks</a></li><li class="tocline"><a class="tocxref" href="#initdata-encountered"><bdi class="secno">7.3.2 </bdi>Initialization Data Encountered</a></li><li class="tocline"><a class="tocxref" href="#encrypted-block-encountered"><bdi class="secno">7.3.3 </bdi>Encrypted Block Encountered</a></li><li class="tocline"><a class="tocxref" href="#attempt-to-decrypt"><bdi class="secno">7.3.4 </bdi>Attempt to Decrypt</a></li><li class="tocline"><a class="tocxref" href="#wait-for-key"><bdi class="secno">7.3.5 </bdi>Wait for Key</a></li><li class="tocline"><a class="tocxref" href="#resume-playback"><bdi class="secno">7.3.6 </bdi>Attempt to Resume Playback If Necessary</a></li></ol></li><li class="tocline"><a class="tocxref" href="#media-element-restrictions"><bdi class="secno">7.4 </bdi>Media Element Restrictions</a></li></ol></li><li class="tocline"><a class="tocxref" href="#implementation-requirements"><bdi class="secno">8. </bdi>Implementation Requirements</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#cdm-constraint-requirements"><bdi class="secno">8.1 </bdi>CDM Constraints</a></li><li class="tocline"><a class="tocxref" href="#messaging-requirements"><bdi class="secno">8.2 </bdi>Messages and Communication</a></li><li class="tocline"><a class="tocxref" href="#persistent-state-requirements"><bdi class="secno">8.3 </bdi>Persistent Data</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#use-origin-specific-key-system-storage"><bdi class="secno">8.3.1 </bdi>Use origin-specific and browsing profile-specific Key System storage</a></li><li class="tocline"><a class="tocxref" href="#allow-persistent-data-cleared"><bdi class="secno">8.3.2 </bdi>Allow Persistent Data to Be Cleared</a></li><li class="tocline"><a class="tocxref" href="#encrypt-or-obfuscate-persistent-data"><bdi class="secno">8.3.3 </bdi>Encrypt or obfuscate Persistent Data</a></li></ol></li><li class="tocline"><a class="tocxref" href="#exposed-value-requirements"><bdi class="secno">8.4 </bdi>Values Exposed to the Application</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#per-origin-per-profile-values"><bdi class="secno">8.4.1 </bdi>Use Per-Origin Per-Profile Values</a></li><li class="tocline"><a class="tocxref" href="#allow-values-to-be-cleared"><bdi class="secno">8.4.2 </bdi>Allow Values to Be Cleared</a></li></ol></li><li class="tocline"><a class="tocxref" href="#identifier-requirements"><bdi class="secno">8.5 </bdi>Identifiers</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#limit-or-avoid-use-of-distinctive-identifiers-and-permanent-identifiers"><bdi class="secno">8.5.1 </bdi>Limit or Avoid use of Distinctive Identifiers and Permanent Identifiers</a></li><li class="tocline"><a class="tocxref" href="#encrypt-identifiers"><bdi class="secno">8.5.2 </bdi>Encrypt Identifiers</a></li><li class="tocline"><a class="tocxref" href="#per-origin-per-profile-identifiers"><bdi class="secno">8.5.3 </bdi>Use Per-Origin Per-Profile Identifiers</a></li><li class="tocline"><a class="tocxref" href="#non-associable-identifiers"><bdi class="secno">8.5.4 </bdi>Use Non-Associable Identifiers</a></li><li class="tocline"><a class="tocxref" href="#allow-identifiers-cleared"><bdi class="secno">8.5.5 </bdi>Allow Identifiers to Be Cleared</a></li></ol></li><li class="tocline"><a class="tocxref" href="#individualization"><bdi class="secno">8.6 </bdi>Individualization</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#direct-individualization"><bdi class="secno">8.6.1 </bdi>Direct Individualization</a></li><li class="tocline"><a class="tocxref" href="#app-assisted-individualization"><bdi class="secno">8.6.2 </bdi>App-Assisted Individualization</a></li></ol></li><li class="tocline"><a class="tocxref" href="#support-multiple-keys"><bdi class="secno">8.7 </bdi>Support Multiple Keys</a></li><li class="tocline"><a class="tocxref" href="#initialization-data-type-support-requirements"><bdi class="secno">8.8 </bdi>Initialization Data Type Support</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#licenses-generated-are-independent-of-content-type"><bdi class="secno">8.8.1 </bdi>Licenses Generated are Independent of Content Type</a></li><li class="tocline"><a class="tocxref" href="#support-extraction-from-media-data"><bdi class="secno">8.8.2 </bdi>Support Extraction From Media Data</a></li></ol></li><li class="tocline"><a class="tocxref" href="#media-requirements"><bdi class="secno">8.9 </bdi>Supported Media</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#unencrypted-container"><bdi class="secno">8.9.1 </bdi>Unencrypted Container</a></li><li class="tocline"><a class="tocxref" href="#interoperably-encrypted"><bdi class="secno">8.9.2 </bdi>Interoperably Encrypted</a></li><li class="tocline"><a class="tocxref" href="#unencrypted-in-band-support-content"><bdi class="secno">8.9.3 </bdi>Unencrypted In-band Support Content</a></li></ol></li></ol></li><li class="tocline"><a class="tocxref" href="#common-key-systems"><bdi class="secno">9. </bdi>Common Key Systems</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#clear-key"><bdi class="secno">9.1 </bdi>Clear Key</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#clear-key-capabilities"><bdi class="secno">9.1.1 </bdi>Capabilities</a></li><li class="tocline"><a class="tocxref" href="#clear-key-behavior"><bdi class="secno">9.1.2 </bdi>Behavior</a></li><li class="tocline"><a class="tocxref" href="#clear-key-request-format"><bdi class="secno">9.1.3 </bdi>License Request Format</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#clear-key-request-format-example"><bdi class="secno">9.1.3.1 </bdi>Example</a></li></ol></li><li class="tocline"><a class="tocxref" href="#clear-key-license-format"><bdi class="secno">9.1.4 </bdi>License Format</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#clear-key-license-format-example"><bdi class="secno">9.1.4.1 </bdi>Example</a></li></ol></li><li class="tocline"><a class="tocxref" href="#clear-key-release-format"><bdi class="secno">9.1.5 </bdi>License Release Format</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#clear-key-release-format-example-1"><bdi class="secno">9.1.5.1 </bdi>Example message reflecting a <span def-id="record-of-license-destruction" class="formerLink"></span></a></li><li class="tocline"><a class="tocxref" href="#clear-key-release-format-example-2"><bdi class="secno">9.1.5.2 </bdi>Example message reflecting a <span def-id="record-of-key-usage" class="formerLink"></span></a></li></ol></li><li class="tocline"><a class="tocxref" href="#clear-key-release-ack-format"><bdi class="secno">9.1.6 </bdi>License Release Acknowledgement Format</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#clear-key-release-ack-format-example"><bdi class="secno">9.1.6.1 </bdi>Example</a></li></ol></li><li class="tocline"><a class="tocxref" href="#using-base64url"><bdi class="secno">9.1.7 </bdi>Using base64url</a></li></ol></li></ol></li><li class="tocline"><a class="tocxref" href="#security"><bdi class="secno">10. </bdi>Security</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#input-data-security"><bdi class="secno">10.1 </bdi>Input Data Attacks and Vulnerabilities</a></li><li class="tocline"><a class="tocxref" href="#cdm-security"><bdi class="secno">10.2 </bdi>CDM Attacks and Vulnerabilities</a></li><li class="tocline"><a class="tocxref" href="#network-attacks"><bdi class="secno">10.3 </bdi>Network Attacks</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#potential-attacks"><bdi class="secno">10.3.1 </bdi>Potential Attacks</a></li><li class="tocline"><a class="tocxref" href="#mitigations"><bdi class="secno">10.3.2 </bdi>Mitigations</a></li></ol></li><li class="tocline"><a class="tocxref" href="#iframe-attacks"><bdi class="secno">10.4 </bdi><code>iframe</code> Attacks</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#potential-attacks-0"><bdi class="secno">10.4.1 </bdi>Potential Attacks</a></li><li class="tocline"><a class="tocxref" href="#mitigations-0"><bdi class="secno">10.4.2 </bdi>Mitigations</a></li></ol></li><li class="tocline"><a class="tocxref" href="#cross-directory-attacks"><bdi class="secno">10.5 </bdi>Cross-Directory Attacks</a></li></ol></li><li class="tocline"><a class="tocxref" href="#privacy"><bdi class="secno">11. </bdi>Privacy</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#privacy-disclosure"><bdi class="secno">11.1 </bdi>Information Disclosed by EME and Key Systems</a></li><li class="tocline"><a class="tocxref" href="#privacy-fingerprinting"><bdi class="secno">11.2 </bdi>Fingerprinting</a></li><li class="tocline"><a class="tocxref" href="#privacy-leakage"><bdi class="secno">11.3 </bdi>Information Leakage</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#concerns"><bdi class="secno">11.3.1 </bdi>Concerns</a></li><li class="tocline"><a class="tocxref" href="#mitigations-1"><bdi class="secno">11.3.2 </bdi>Mitigations</a></li></ol></li><li class="tocline"><a class="tocxref" href="#user-tracking"><bdi class="secno">11.4 </bdi>User Tracking</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#concerns-0"><bdi class="secno">11.4.1 </bdi>Concerns</a></li><li class="tocline"><a class="tocxref" href="#mitigations-2"><bdi class="secno">11.4.2 </bdi>Mitigations</a></li></ol></li><li class="tocline"><a class="tocxref" href="#privacy-storedinfo"><bdi class="secno">11.5 </bdi>Information Stored on User Devices</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#concerns-1"><bdi class="secno">11.5.1 </bdi>Concerns</a></li><li class="tocline"><a class="tocxref" href="#mitigations-3"><bdi class="secno">11.5.2 </bdi>Mitigations</a></li></ol></li><li class="tocline"><a class="tocxref" href="#incomplete-clearing"><bdi class="secno">11.6 </bdi>Incomplete Clearing of Data</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#concerns-2"><bdi class="secno">11.6.1 </bdi>Concerns</a></li><li class="tocline"><a class="tocxref" href="#mitigations-4"><bdi class="secno">11.6.2 </bdi>Mitigations</a></li></ol></li><li class="tocline"><a class="tocxref" href="#private-browsing"><bdi class="secno">11.7 </bdi>Private Browsing Modes</a></li><li class="tocline"><a class="tocxref" href="#privacy-secureorigin"><bdi class="secno">11.8 </bdi>Secure Origin and Transport</a></li></ol></li><li class="tocline"><a class="tocxref" href="#conformance"><bdi class="secno">12. </bdi>Conformance</a></li><li class="tocline"><a class="tocxref" href="#examples"><bdi class="secno">13. </bdi>Examples</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#example-source-and-key-known"><bdi class="secno">13.1 </bdi>Source and Key Known at Page Load (Clear Key)</a></li><li class="tocline"><a class="tocxref" href="#example-selecting-key-system"><bdi class="secno">13.2 </bdi>Selecting a Supported Key System and Using Initialization Data from the "encrypted" Event</a></li><li class="tocline"><a class="tocxref" href="#example-mediakeys-before-source"><bdi class="secno">13.3 </bdi>Create MediaKeys Before Loading Media</a></li><li class="tocline"><a class="tocxref" href="#example-using-all-events"><bdi class="secno">13.4 </bdi>Using All Events</a></li><li class="tocline"><a class="tocxref" href="#example-stored-license"><bdi class="secno">13.5 </bdi>Stored License</a></li></ol></li><li class="tocline"><a class="tocxref" href="#acknowledgements"><bdi class="secno">14. </bdi>Acknowledgments</a></li><li class="tocline"><a class="tocxref" href="#references"><bdi class="secno">A. </bdi>References</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#normative-references"><bdi class="secno">A.1 </bdi>
Normative references
</a></li><li class="tocline"><a class="tocxref" href="#informative-references"><bdi class="secno">A.2 </bdi>
Informative references
</a></li></ol></li></ol></nav>
<section id="introduction" class="informative">
<h2 id="x1-introduction"><bdi class="secno">1. </bdi>Introduction<a class="self-link" aria-label="§" href="#introduction"></a></h2><p><em>This section is non-normative.</em></p>
<p>
This specification enables script to select content protection mechanisms, control license/key exchange, and
execute custom license management algorithms.
It supports a wide range of use cases without requiring client-side modifications in each user agent for each use case.
This enables content providers to develop a single application solution for all devices.
</p>
<p>
Supported content is encrypted per container-specific "common encryption" specifications, enabling use across key systems.
Supported content has an unencrypted container, enabling metadata to be provided to the application and maintaining compatibility with other <code><a href="https://www.w3.org/TR/html51/semantics-embedded-content.html#htmlmediaelement-htmlmediaelement">HTMLMediaElement</a></code> features.
</p>
<p>
Implementers should pay attention to the mitigations for the security and privacy threats and concerns described in this specification.
In particular, the specification requirements for security and privacy cannot be met without knowledge of the security and privacy properties of the <a href="#key-system">Key System</a> and its implementation(s).
<a href="#implementation-requirements" class="sec-ref">§ <bdi class="secno">8. </bdi>Implementation Requirements</a> contains security and privacy provisions related to the integration and use of underlying <a href="#key-system">Key System</a> implementations.
<a href="#security" class="sec-ref">§ <bdi class="secno">10. </bdi>Security</a> focuses on external threats, such as input data or network attacks.
<a href="#privacy" class="sec-ref">§ <bdi class="secno">11. </bdi>Privacy</a> focuses on the handling of user-specific information and providing users with adequate control over their own privacy.
</p>
<div class="note" role="note" id="issue-container-generatedID"><div role="heading" class="note-title marker" id="h-note" aria-level="3"><span>Note</span></div><p class="">
While this specification is independent of the source of the media data, authors should be aware that many implementations only support decrypting media data provided via Media Source Extensions [<cite><a class="bibref" data-link-type="biblio" href="#bib-media-source" title="Media Source Extensions™">MEDIA-SOURCE</a></cite>].
</p></div>
<p>
A generic stack implemented using the API is shown below.
This diagram shows an example flow; other combinations of API calls and events are possible.
</p>
<img src="stack_overview.svg" alt="A generic stack implemented using the proposed APIs" height="700">
</section>
<section id="definitions">
<h2 id="x2-definitions"><bdi class="secno">2. </bdi>Definitions<a class="self-link" aria-label="§" href="#definitions"></a></h2>
<dl>
<dt id="cdm">Content Decryption Module (CDM)</dt>
<dd>
<p>Content Decryption Module (CDM) is the client component that provides the functionality, including decryption, for one or more <a href="#key-system">Key Systems</a>.</p>
<div class="note" role="note" id="issue-container-generatedID-0"><div role="heading" class="note-title marker" id="h-note-0" aria-level="3"><span>Note</span></div><p class="">
Implementations may or may not separate the implementations of CDMs or treat them as separate from the user agent.
This is transparent to the API and application.
</p></div>
</dd>
<dt id="key-system">Key System</dt>
<dd>
<p>A Key System is a generic term for a decryption mechanism and/or content protection provider.
Key System strings provide unique identification of a Key System.
They are used by the user agent to select a <a href="#cdm">CDM</a> and identify the source of a key-related event.
User agents <em class="rfc2119" title="MUST">MUST</em> support the <a href="#common-key-systems">Common Key Systems</a>.
User agents <em class="rfc2119" title="MAY">MAY</em> also provide additional CDMs with corresponding Key System strings.
</p>
<p>A Key System string is always a reverse domain name.
Key System strings are compared using case-sensitive matching. It is <em class="rfc2119" title="RECOMMENDED">RECOMMENDED</em> that CDMs use simple lower-case ASCII key system strings.</p>
<div class="note" role="note" id="issue-container-generatedID-1"><div role="heading" class="note-title marker" id="h-note-1" aria-level="3"><span>Note</span></div><p class="">For example, "com.example.somesystem".</p></div>
<div class="note" role="note" id="issue-container-generatedID-2"><div role="heading" class="note-title marker" id="h-note-2" aria-level="3"><span>Note</span></div><p class="">
Within a given system ("somesystem" in the example), subsystems may be defined as determined by the key system provider.
For example, "com.example.somesystem.1" and "com.example.somesystem.1_5".
Key System providers should keep in mind that these will be used for comparison and discovery, so they should be easy to compare and the structure should remain reasonably simple.
</p></div>
</dd>
<dt id="key-session">Key Session</dt>
<dd>
<p>A Key Session, or simply Session, provides a context for message exchange with the <a href="#cdm">CDM</a> as a result of which key(s) are made available to the CDM.
Sessions are embodied as <a href="#dom-mediakeysession" class="internalDFN" data-link-type="idl"><code>MediaKeySession</code></a> objects.
Each Key session is associated with a single instance of <a href="#initialization-data">Initialization Data</a> provided in the <code><a href="#dom-mediakeysession-generaterequest">generateRequest()</a></code> call.
</p>
<p>Each Key Session is associated with a single <a href="#dom-mediakeys" class="internalDFN" data-link-type="idl"><code>MediaKeys</code></a> object, and only media element(s) associated with that <a href="#dom-mediakeys" class="internalDFN" data-link-type="idl"><code>MediaKeys</code></a> object may access key(s) associated with the session.
Other <a href="#dom-mediakeys" class="internalDFN" data-link-type="idl"><code>MediaKeys</code></a> objects, CDM instances, and media elements <em class="rfc2119" title="MUST NOT">MUST NOT</em> access the key session or use its key(s).
Key sessions and the keys they contain are no longer <a href="#usable-for-decryption">usable for decryption</a> once the session has been closed, including when the <a href="#dom-mediakeysession" class="internalDFN" data-link-type="idl"><code>MediaKeySession</code></a> object is destroyed.
</p>
<p>
All license(s) and key(s) associated with a Key Session which have not been explicitly stored <em class="rfc2119" title="MUST">MUST</em> be destroyed when the Key Session is closed.
</p>
<p><a href="#decryption-key-id">Key IDs</a> <em class="rfc2119" title="MUST">MUST</em> be unique within a session.</p>
</dd>
<dt id="session-id">Session ID</dt>
<dd>
<p>A Session ID is a unique string identifier generated by the <a href="#cdm">CDM</a> that can be used by the application to identify <a href="#dom-mediakeysession" class="internalDFN" data-link-type="idl"><code>MediaKeySession</code></a> objects.</p>
<p>A new Session ID is generated each time the user agent and CDM successfully create a new session.</p>
<p>Each Session ID <em class="rfc2119" title="SHALL">SHALL</em> be unique within the browsing context in which it was created.
For session types for which the <a href="#is-persistent-session-type">Is persistent session type?</a> algorithm returns <code>true</code>, Session IDs <em class="rfc2119" title="MUST">MUST</em> be unique within the <a href="https://www.w3.org/TR/html51/browsers.html#concept-cross-origin">origin</a> over time, including across browsing sessions.
</p>
<div class="note" role="note" id="issue-container-generatedID-3"><div role="heading" class="note-title marker" id="h-note-3" aria-level="3"><span>Note</span></div><p class="">The underlying content protection protocol does not necessarily need to support Session IDs.</p></div>
</dd>
<dt id="decryption-key">Key</dt>
<dd>
<p>Unless otherwise stated, key refers to a decryption key that can be used to decrypt blocks within <a href="https://www.w3.org/TR/html51/semantics-embedded-content.html#media-data">media data</a>.
Each such key is uniquely identified by a <a href="#decryption-key-id">key ID</a>.
A key is associated with the <a href="#key-session">session</a> used to provide it to the <a href="#cdm">CDM</a>. (The same key may be present in multiple sessions.)
Such keys <em class="rfc2119" title="MUST">MUST</em> only be provided to the CDM via an <code><a href="#dom-mediakeysession-update">update()</a></code> call. (They may later be loaded by <code><a href="#dom-mediakeysession-load">load()</a></code> as part of the stored session data.)
</p>
<div class="note" role="note" id="issue-container-generatedID-4"><div role="heading" class="note-title marker" id="h-note-4" aria-level="3"><span>Note</span></div><p class="">Authors <em class="rfc2119" title="SHOULD">SHOULD</em> encrypt each set of stream(s) that requires enforcement of a meaningfully different policy with a distinct key (and key ID).
For example, if policies may differ between two video resolutions, stream(s) containing one resolution should not be encrypted with the key used to encrypt stream(s) containing the other resolution.
When encrypted, audio streams <em class="rfc2119" title="SHOULD NOT">SHOULD NOT</em> use the same key as any video stream.
This is the only way to ensure enforcement and compatibility across clients.
</p></div>
</dd>
<dt id="usable-for-decryption">Usable For Decryption</dt>
<dd>
<p>A key is considered usable for decryption if the CDM is certain the key is currently usable to decrypt one or more blocks of <a href="https://www.w3.org/TR/html51/semantics-embedded-content.html#media-data">media data</a>.</p>
<div class="note" role="note" id="issue-container-generatedID-5"><div role="heading" class="note-title marker" id="h-note-5" aria-level="3"><span>Note</span></div><p class="">For example, a key is not usable for decryption if its license has expired. Even if its license has not expired, a key is not usable for decryption if other conditions (e.g., output protection) for its use are not currently satisfied.</p></div>
</dd>
<dt id="decryption-key-id">Key ID</dt>
<dd>
<p>A <a href="#decryption-key">key</a> is associated with a key ID that is a sequence of octets and which uniquely identifies the key.
The container specifies the ID of the key that can decrypt a block or set of blocks within the <a href="https://www.w3.org/TR/html51/semantics-embedded-content.html#media-data">media data</a>.
<a href="#initialization-data">Initialization Data</a> <em class="rfc2119" title="MAY">MAY</em> contain key ID(s) to identify the keys that are needed to decrypt the media data.
However, there is no requirement that Initialization Data contain any or all key IDs used in the <a href="https://www.w3.org/TR/html51/semantics-embedded-content.html#media-data">media data</a> or <a href="https://www.w3.org/TR/html51/semantics-embedded-content.html#media-resource">media resource</a>.
<a href="#license">Licenses</a> provided to the <a href="#cdm">CDM</a> associate each key with a key ID so the CDM can select the appropriate key when decrypting an encrypted block of media data.
</p>
</dd>
<dt id="known-key">Known Key</dt>
<dd>
<p>A key is considered to be known to a session if the <a href="#cdm">CDM</a>'s implementation of the session contains any information - specifically the <a href="#decryption-key-id">key ID</a> - about it, regardless of whether the actual <a href="#decryption-key">key</a> is usable or its value is known.
Known keys are exposed via the <code><a href="#dom-mediakeysession-keystatuses">keyStatuses</a></code> attribute.
</p>
<p>Keys are considered known even after they become unusable, such as due to <a href="#expiration-time">expiration</a> or if they are removed but a <a href="#record-of-license-destruction">record of license destruction</a> or <a href="#record-of-key-usage">record of key usage</a> is available.
Keys only become unknown when they are explicitly removed from a session and any license release message is acknowledged.
</p>
<div class="note" role="note" id="issue-container-generatedID-6"><div role="heading" class="note-title marker" id="h-note-6" aria-level="3"><span>Note</span></div><p class="">For example, a key could become unknown if an <code><a href="#dom-mediakeysession-update">update()</a></code> call provides a new license that does not include the key and includes instructions to replace the license(s) that previously contained the key.</p></div>
</dd>
<dt id="license">License</dt>
<dd>
<p>A license is key system-specific state information that includes one or more <a href="#decryption-key">key(s)</a> - each associated with a <a href="#decryption-key-id">key ID</a> - and potentially other information about key usage.</p>
</dd>
<dt id="initialization-data">Initialization Data</dt>
<dd>
<div class="note" role="note" id="issue-container-generatedID-7"><div role="heading" class="note-title marker" id="h-note-7" aria-level="3"><span>Note</span></div><p class="">
<a href="#key-system">Key Systems</a> usually require a block of initialization data containing information about the stream to be decrypted before they can construct a license request message.
This block could be a simple key or content ID or a more complex structure containing such information.
It <em class="rfc2119" title="SHOULD">SHOULD</em> always allow unique identification of the <a href="#decryption-key">key(s)</a> needed to decrypt the content.
This initialization information <em class="rfc2119" title="MAY">MAY</em> be obtained in some application-specific way or provided with the <a href="https://www.w3.org/TR/html51/semantics-embedded-content.html#media-data">media data</a>.
</p></div>
<p>
Initialization Data is a generic term for container-specific data that is used by a <a href="#cdm">CDM</a> to generate a license request.
</p>
<p>
The format of the initialization data depends upon the type of container, and containers <em class="rfc2119" title="MAY">MAY</em> support more than one format
of initialization data. The <dfn id="initialization-data-type" data-dfn-type="dfn">Initialization Data Type</dfn> is a string that indicates the
format of the accompanying Initialization Data. Initialization Data Type strings are always matched case-sensitively. It is
<em class="rfc2119" title="RECOMMENDED">RECOMMENDED</em> that Initialization Data Type strings are lower-case ASCII strings.
</p>
<p>
The Encrypted Media Extensions Stream Format and Initialization Data Format Registry [<cite><a class="bibref" data-link-type="biblio" href="#bib-eme-initdata-registry" title="Encrypted Media Extensions Initialization Data Format Registry">EME-INITDATA-REGISTRY</a></cite>]
provides the mapping from <a href="#initialization-data-type">Initialization Data Type</a> string to the specification for each format.
</p>
<p>
When the user agent encounters Initialization Data in the <a href="https://www.w3.org/TR/html51/semantics-embedded-content.html#media-data">media data</a>, it provides that Initialization Data to the application in the <code><a href="#dom-mediaencryptedevent-initdata">initData</a></code> attribute of the <code><a href="#dom-evt-encrypted">encrypted</a></code> event.
The user agent <em class="rfc2119" title="MUST NOT">MUST NOT</em> store the Initialization Data or use its <em>content</em> at the time it is encountered.
The application provides Initialization Data to the CDM via <code><a href="#dom-mediakeysession-generaterequest">generateRequest()</a></code>.
The user agent <em class="rfc2119" title="MUST NOT">MUST NOT</em> provide Initialization Data to the CDM by other means.
</p>
<p>Initialization Data <em class="rfc2119" title="MUST">MUST</em> be a fixed value for a given set of stream(s) or <a href="https://www.w3.org/TR/html51/semantics-embedded-content.html#media-data">media data</a>.
It <em class="rfc2119" title="MUST">MUST</em> only contain information related to the keys required to play a given set of stream(s) or <a href="https://www.w3.org/TR/html51/semantics-embedded-content.html#media-data">media data</a>.
It <em class="rfc2119" title="MUST NOT">MUST NOT</em> contain application data, client-specific data, user-specific data, or executable code.
</p>
<p>Initialization Data <em class="rfc2119" title="SHOULD NOT">SHOULD NOT</em> contain Key System-specific data or values.
Implementations <em class="rfc2119" title="MUST">MUST</em> support the common formats defined in [<cite><a class="bibref" data-link-type="biblio" href="#bib-eme-initdata-registry" title="Encrypted Media Extensions Initialization Data Format Registry">EME-INITDATA-REGISTRY</a></cite>] for each <a href="#initialization-data-type">Initialization Data Type</a> they support.
</p>
<div class="note" role="note" id="issue-container-generatedID-8"><div role="heading" class="note-title marker" id="h-note-8" aria-level="3"><span>Note</span></div><p class="">
Use of proprietary formats/contents is discouraged, and supporting or using <em>only</em> proprietary formats is strongly discouraged.
Proprietary formats should only be used with pre-existing content or on pre-existing client devices that do not support the common formats.
</p></div>
</dd>
<dt>Associable Values</dt>
<dd>
<p>
Two or more identifiers or other values are said to be <dfn id="associable" data-dfn-type="dfn">associable</dfn> if they are identical <em>or</em> it is possible - with a reasonable amount of time and effort - to correlate or associate them.
Otherwise, the values are <dfn id="non-associable" data-dfn-type="dfn">non-associable</dfn>.
</p>
<div class="note" role="note" id="issue-container-generatedID-9"><div role="heading" class="note-title marker" id="h-note-9" aria-level="3"><span>Note</span></div><div class="">
<p>For example, values created in the following ways are <a href="#associable">associable</a>:</p>
<ul>
<li><p>Using a trivially-reversible hash function.</p></li>
<li><p>Sharing a prefix or other subset</p></li>
<li><p>Replacing random value N with N+10</p></li>
<li><p>XORing the origin with a fixed value (because it is trivially reversible)</p></li>
</ul>
<p>In contrast, two values that are completely unrelated or cryptographically distinct, such as via a cryptographically strong non-reversible hash function, are <a href="#non-associable">non-associable</a>.</p>
</div></div>
<p>Two or more identifiers or other values are said to be <dfn id="associable-by-entity" data-dfn-type="dfn">associable by an entity</dfn> if it is possible - with a reasonable amount of time and effort - for the referenced entity or set of entities to correlate or associate them without participation of additional entity(ies).
Otherwise, the values are <dfn id="non-associable-by-entity" data-dfn-type="dfn">non-associable by an entity</dfn>.
</p>
<p>Two or more identifiers or other values are said to be <dfn id="non-associable-by-application" data-dfn-type="dfn">non-associable by the application</dfn> if they are <a href="#non-associable-by-entity">non-associable by an entity</a>
where the entity is set that includes the application, all other applications, and other entities such as servers that they use or with which they communicate.
Otherwise, the values would be considered <dfn id="associable-by-application" data-dfn-type="dfn">associable by the application</dfn>, which is forbidden.
</p>
</dd>
<dt id="distinctive-value">Distinctive Value</dt>
<dd>
<p>
A Distinctive Value is a value, piece of data, implication of the possession of a piece of data, or an observable behavior or timing that is <em>not</em> shared across a large population of users or client devices.
A Distinctive Value may be in memory or persisted.
</p>
<div class="note" role="note" id="issue-container-generatedID-10"><div role="heading" class="note-title marker" id="h-note-10" aria-level="3"><span>Note</span></div><div class="">
<p>Examples of Distinctive Values include but are not limited to:</p>
<ul>
<li><p><a href="#distinctive-identifier">Distinctive Identifiers</a></p></li>
<li><p><a href="#distinctive-permanent-identifier">Distinctive Permanent Identifiers</a></p></li>
<li><p>Other identifiers</p></li>
<li><p><a href="#session-id">Session IDs</a></p></li>
<li><p><a href="#license">Licenses</a></p></li>
<li><p>Other session data</p></li>
</ul>
</div></div>
<div class="note" role="note" id="issue-container-generatedID-11"><div role="heading" class="note-title marker" id="h-note-11" aria-level="3"><span>Note</span></div><p class="">While a Distinctive Value is typically unique to a user or client device, a value does not need to be strictly unique to be distinctive.
For example, a value shared among a small number of users could still be distinctive.
</p></div>
</dd>
<dt>Permanent Identifiers</dt>
<dd>
<p>
A <dfn id="permanent-identifier" data-dfn-type="dfn">Permanent Identifier</dfn> is a value, piece of data, implication of the possession of a piece of data, or an observable behavior or timing that is indelible in some way or otherwise non-trivial for the user to remove, reset, or change.
This, includes but is not limited to:
</p>
<ul>
<li><p>A hardware or hardware-based identifier</p></li>
<li><p>A value provisioned in the hardware device in the factory</p></li>
<li><p>A value associated with or derived from the operating system installation instance</p></li>
<li><p>A value associated with or derived from the user agent installation instance</p></li>
<li><p>A value associated with or derived from the <a href="#cdm">CDM</a> or other software component</p></li>
<li><p>A value in a configuration file or similar semi-permanent data, even if generated on the client</p></li>
<li><p>Client or other user account values</p></li>
</ul>
<p>
A <dfn id="distinctive-permanent-identifier" data-dfn-type="dfn">Distinctive Permanent Identifier</dfn> is a <a href="#permanent-identifier">Permanent Identifier</a> that is <a href="#distinctive-value">distinctive</a>.
</p>
<p>
When exposed outside the client, Distinctive Permanent Identifiers and values derived from or otherwise related to them <em class="rfc2119" title="MUST">MUST</em> be <a href="#encrypt-identifiers">encrypted</a>.
Distinctive Permanent Identifiers <em class="rfc2119" title="MUST NOT">MUST NOT</em> ever be exposed to the application, even in encrypted form.
</p>
<div class="note" role="note" id="issue-container-generatedID-12"><div role="heading" class="note-title marker" id="h-note-12" aria-level="3"><span>Note</span></div><p class="">While a Distinctive Permanent Identifier is typically unique to a user or client device, a Distinctive Permanent Identifier does not need to be strictly unique to be distinctive.
For example, a Distinctive Permanent Identifier shared among a small number of users could still be distinctive.
</p></div>
<div class="note" role="note" id="issue-container-generatedID-13"><div role="heading" class="note-title marker" id="h-note-13" aria-level="3"><span>Note</span></div><p class="">
A Distinctive Permanent Identifier is <em>not</em> a <a href="#distinctive-identifier">Distinctive Identifier</a> because it is not derived or generated (within the scope of this specification).
</p></div>
<div class="note" role="note" id="issue-container-generatedID-14"><div role="heading" class="note-title marker" id="h-note-14" aria-level="3"><span>Note</span></div><p class="">
<code><a href="#dom-mediakeysystemconfiguration-distinctiveidentifier">distinctiveIdentifier</a></code> controls whether Distinctive Permanent Identifiers may be used.
Specifically, Distinctive Permanent Identifiers may only be used when the value of the <code><a href="#dom-mediakeysystemconfiguration-distinctiveidentifier">distinctiveIdentifier</a></code> member of the <a href="#dom-mediakeysystemaccess" class="internalDFN" data-link-type="idl"><code>MediaKeySystemAccess</code></a> used to create the <a href="#dom-mediakeys" class="internalDFN" data-link-type="idl"><code>MediaKeys</code></a> object is <code><a href="#idl-def-MediaKeysRequirement.required">"required"</a></code>.
</p></div>
</dd>
<dt id="distinctive-identifier">Distinctive Identifier</dt>
<dd>
<div class="note" role="note" id="issue-container-generatedID-15"><div role="heading" class="note-title marker" id="h-note-15" aria-level="3"><span>Note</span></div><div class="">
<p>
A Distinctive Identifier is a value, including in opaque or encrypted form, for which it is possible for any entity external to the client to correlate or associate values beyond what a user may expect on the web platform (e.g., cookies and other site data).
For example, values that are <a href="#associable-by-entity">associable by an entity other than the application</a> across
a) <a href="https://www.w3.org/TR/html51/browsers.html#concept-cross-origin">origins</a>,
b) <a href="#browsing-profile">browsing profiles</a>,
or c) browsing sessions even after the user has attempted to protect his or her privacy by clearing browsing data
or values for which it is not easy for a user to break such association.
In particular, a value is a Distinctive Identifier if it is possible for a <a href="#associable-by-entity">central server, such as an individualization server, to associate</a> values across origins, such as because the <a href="#individualization">individualization</a> requests contained a common value, or because values provided in individualization requests are <a href="#associable-by-entity">associable by such server</a> even after attempts to clear browsing data.
Possible causes of this include use of <a href="#distinctive-permanent-identifier">Distinctive Permanent Identifier(s)</a> in the individualization process.
</p>
<p>
Distinctive Identifiers exposed to the application, even in encrypted form, <em class="rfc2119" title="MUST">MUST</em> adhere to the <a href="#identifier-requirements">identifier requirements</a>,
including being <a href="#encrypt-identifiers">encrypted</a>, <a href="#per-origin-per-profile-identifiers">unique per origin and profile</a>, and <a href="#allow-identifiers-cleared">clearable</a>.
</p>
<p>
While the instantiation or use of a Distinctive Identifier is triggered by the application's use of the APIs defined in this specification, the identifier need not be provided to the application to trigger conditions related to Distinctive Identifiers.
(The <a href="#distinctive-permanent-identifier">Distinctive Permanent Identifier(s)</a> <em class="rfc2119" title="MUST NOT">MUST NOT</em> ever be provided to the application, even in opaque or encrypted form.)
</p>
</div></div>
<div class="note" role="note" id="issue-container-generatedID-16"><div role="heading" class="note-title marker" id="h-note-16" aria-level="3"><span>Note</span></div><p class="">
<code><a href="#dom-mediakeysystemconfiguration-distinctiveidentifier">distinctiveIdentifier</a></code> controls whether Distinctive Identifiers may be used.
Specifically, Distinctive Identifiers may only be used when the value of the <code><a href="#dom-mediakeysystemconfiguration-distinctiveidentifier">distinctiveIdentifier</a></code> member of the <a href="#dom-mediakeysystemaccess" class="internalDFN" data-link-type="idl"><code>MediaKeySystemAccess</code></a> used to create the <a href="#dom-mediakeys" class="internalDFN" data-link-type="idl"><code>MediaKeys</code></a> object is <code><a href="#idl-def-MediaKeysRequirement.required">"required"</a></code>.
</p></div>
<p>A Distinctive Identifier is a value, piece of data, implication of the possession of a piece of data, or an observable behavior or timing for which all of the following criteria hold:</p>
<ul>
<li>
<p>It is <a href="#distinctive-value">distinctive</a>.</p>
<div class="note" role="note" id="issue-container-generatedID-17"><div role="heading" class="note-title marker" id="h-note-17" aria-level="3"><span>Note</span></div><p class="">While a Distinctive Identifier is typically unique to a user or client device, an identifier does not need to be strictly unique to be distinctive.
For example, an identifier shared among a small number of users could still be distinctive.
</p></div>
</li>
<li>
<p>It, information about it, or values derived from or otherwise related to it are exposed, even in encrypted form, outside the client.
This includes but is not limited to providing it to the application and/or license, <a href="#individualization">individualization</a>, or other server.
</p>
</li>
<li><p>It has one or more the following properties:</p>
<ul>
<li><p>It is derived from one or more <a href="#distinctive-permanent-identifier">Distinctive Permanent Identifier(s)</a>.</p></li>
<li><p>The generation, <a href="#individualization">individualization</a>, provisioning or other process that produced the value involved, used, provided, derived from, or similarly involved one or more <a href="#distinctive-permanent-identifier">Distinctive Permanent Identifier(s)</a> or another Distinctive Identifier.</p></li>
<li>
<p>It is <a href="#allow-identifiers-cleared">clearable</a> but not <a href="#allow-persistent-data-cleared-with-cookies">along with cookies and other site data</a>.</p>
<div class="note" role="note" id="issue-container-generatedID-18"><div role="heading" class="note-title marker" id="h-note-18" aria-level="3"><span>Note</span></div><p class="">For example, via some mechanism external to the user agent, such as an OS-level mechanism.</p></div>
</li>
</ul>
<div class="note" role="note" id="issue-container-generatedID-19"><div role="heading" class="note-title marker" id="h-note-19" aria-level="3"><span>Note</span></div><div class="">
<p>Other properties of concern that are normatively prohibited for values exposed to the application include:</p>
<ul>
<li><p>It is a <a href="#distinctive-permanent-identifier">Distinctive Permanent Identifier</a>.</p></li>
<li><p>It is <em>not</em> <a href="#allow-identifiers-cleared">clearable</a>.</p></li>
<li><p>Value(s) created after <a href="#allow-identifiers-cleared">clearing identifier(s)</a> may be <a href="#associable-by-application">associable by the application</a> with previous value(s).</p></li>
<li><p>Values may not be <a href="#per-origin-per-profile-identifiers">unique per origin and profile</a>.</p></li>
<li><p>Values for different origins may be <a href="#associable-by-application">associable by the application</a>.</p></li>
</ul>
<p>Examples of such normatively prohibited values include but is not limited to:</p>
<ul>
<li><p>A single hardware-based value used for all origins.</p></li>
<li><p>A single random based value used for all origins.</p></li>
<li><p>A single value obtained from an <a href="#individualization">individualization</a> process that is used for all origins.</p></li>
<li><p>Values that include all or part of any of the above values.</p></li>
<li><p>A single value that is used for multiple but not all origins.</p></li>
<li><p>A single value that is used for all origins on a domain. (Identifiers must be per-<a href="https://www.w3.org/TR/html51/browsers.html#concept-cross-origin">origin</a>.)</p></li>
<li><p>A pre-provisioned origin-specific value.</p></li>
<li><p>Values generated by trivially-reversible means, which are thus <a href="#associable-by-application">associable by the application</a>, regardless of whether generated on the client or involving an a <a href="#individualization">individualization</a> process. For example, XORing or otherwise integrating (part of) the origin with a fixed value.</p></li>
</ul>
</div></div>
</li>
</ul>
<div class="note" role="note" id="issue-container-generatedID-20"><div role="heading" class="note-title marker" id="h-note-20" aria-level="3"><span>Note</span></div><p class="">
While Distinctive Identifier are usually <a href="#associable-by-entity">associable by the entity that generated them</a> they <em class="rfc2119" title="MUST">MUST</em> be <a href="#non-associable-by-application">non-associable by applications</a>.
In other words, such correlation or association is only possible by the entity, such as an <a href="#individualization">individualization</a> server, that originally generated the Distinctive Identifier values.
Entities with access to the <a href="#distinctive-permanent-identifier">Distinctive Permanent Identifier(s)</a> <em class="rfc2119" title="MUST NOT">MUST NOT</em> expose this capability to applications, as this would make resulting Distinctive Identifiers <a href="#associable-by-application">associable by the application</a>, and <em class="rfc2119" title="SHOULD">SHOULD</em> take care to avoid exposing such correlation to other entities or third parties.
</p></div>
<div class="note" role="note" id="issue-container-generatedID-21"><div role="heading" class="note-title marker" id="h-note-21" aria-level="3"><span>Note</span></div><div class="">
<p>Examples of Distinctive Identifiers include but are not limited to:</p>
<ul>
<li><p>A series of bytes that is included in key requests, different from the series of bytes included by other client devices, and based on or was acquired directly or indirectly using a <a href="#distinctive-permanent-identifier">Distinctive Permanent Identifier</a>.</p></li>
<li><p>A public key included in key requests that is different from the public keys included in the requests by other client devices and is based on or was acquired directly or indirectly using a <a href="#distinctive-permanent-identifier">Distinctive Permanent Identifier</a>.</p></li>
<li><p>Demonstration of possession of a private key (e.g., by signing some data) that other client devices do not have and is based on or was acquired directly or indirectly using a <a href="#distinctive-permanent-identifier">Distinctive Permanent Identifier</a>.</p></li>
<li><p>An identifier for such a key.</p></li>
<li><p>Such a value used to derive another value that is exposed even though the first value is not directly exposed.</p></li>
<li><p>A value derived from another Distinctive Identifier.</p></li>
<li><p>A random value that was reported to a (e.g., <a href="#individualization">individualization</a>) server along with a <a href="#distinctive-permanent-identifier">Distinctive Permanent Identifier</a> or provided by such a server after providing a <a href="#distinctive-permanent-identifier">Distinctive Permanent Identifier</a>.</p></li>
<li><p>A value derived from a unique value provisioned in the hardware device in the factory.</p></li>
<li><p>A value derived from a unique hardware value (e.g., MAC address or serial number) or software value (e.g., operating system installation instance or operating system user account name) in the hardware device in the factory.</p></li>
<li><p>A value derived from a unique value embedded in the CDM binary or other file used by the CDM.</p></li>
</ul>
<p>Examples of things that are <em>not</em> Distinctive Identifiers:</p>
<ul>
<li><p>A public key shared among all copies of a given CDM version if the installed base is large.</p></li>
<li><p>A nonce or ephemeral key that is unique but used in only one session.</p></li>
<li><p>A value that is not exposed, even in derived or similar ways, outside the client, including via <a href="#individualization">individualization</a> or similar.</p></li>
<li><p>Device-unique keys used in attestations between, for example, the video pipeline and the CDM when the CDM does not let these attestations further flow to the application and instead makes a new attestation on its own using a key that does not constitute a Distinctive Identifier.</p></li>
<li>
<p>A value that is fully cleared/clearable along with browsing data, such as cookies, after which it will be replaced by a value that is <a href="#non-associable">non-associable</a> (not just <a href="#non-associable-by-application">non-associable by applications</a>), even by a central server such as an <a href="#individualization">individualization</a> server, AND one or more of the following:</p>
<ul>
<li><p>No <a href="#distinctive-permanent-identifier">Distinctive Permanent Identifier</a> or Distinctive Identifier was involved in the generation of the value.</p></li>
<li><p>It is a random value generated <em>without</em> inputs from the system.</p></li>
<li><p>It is a value provided by a server without the use of or knowledge of another Distinctive Identifier.</p></li>
</ul>
</li>
</ul>
</div></div>
</dd>
<dt>Use of Distinctive Identifiers and Distinctive Permanent Identifiers</dt>
<dd>
<p>
An implementation, configuration, instance, or object <dfn id="uses-distinctive-identifiers" data-dfn-type="dfn">uses Distinctive Identifier(s)</dfn> if, at any time during its lifetime or the lifetime of related such entities,
it exposes, even in encrypted form, one or more <a href="#distinctive-identifier">Distinctive Identifier(s)</a>, information about them, or values derived from or otherwise related to them outside the client.
This includes but is not limited to providing such a value to the application and/or license, <a href="#individualization">individualization</a>, or other server.
</p>
<p>
An implementation, configuration, instance, or object <dfn id="uses-distinctive-permanent-identifiers" data-dfn-type="dfn">uses Distinctive Permanent Identifier(s)</dfn> if, at any time during its lifetime or the lifetime of related such entities,
it exposes, even in encrypted form, one or more <a href="#distinctive-permanent-identifier">Distinctive Permanent Identifier(s)</a>, information about them, or values derived from or otherwise related to them outside the client.
This includes but is not limited to providing such a value to an <a href="#individualization">individualization</a> server.
Such values <em class="rfc2119" title="MUST NOT">MUST NOT</em> be provided to the application.
</p>
<p>
An implementation, configuration, instance, or object <dfn id="uses-distinctive-identifiers-or-distinctive-permanent-identifiers" data-dfn-type="dfn">uses Distinctive Identifier(s) or Distinctive Permanent Identifier(s)</dfn> if it
<a href="#uses-distinctive-identifiers">uses Distinctive Identifier(s)</a> and/or <a href="#uses-distinctive-permanent-identifiers">uses Distinctive Permanent Identifier(s)</a>.
</p>
<div class="note" role="note" id="issue-container-generatedID-22"><div role="heading" class="note-title marker" id="h-note-22" aria-level="3"><span>Note</span></div><p class="">
<code><a href="#dom-mediakeysystemconfiguration-distinctiveidentifier">distinctiveIdentifier</a></code> controls whether <a href="#distinctive-identifier">Distinctive Identifiers</a> and <a href="#distinctive-permanent-identifier">Distinctive Permanent Identifiers</a> may be used.
Specifically, such identifiers may only be used when the value of the <code><a href="#dom-mediakeysystemconfiguration-distinctiveidentifier">distinctiveIdentifier</a></code> member of the <a href="#dom-mediakeysystemaccess" class="internalDFN" data-link-type="idl"><code>MediaKeySystemAccess</code></a> used to create the <a href="#dom-mediakeys" class="internalDFN" data-link-type="idl"><code>MediaKeys</code></a> object is <code><a href="#idl-def-MediaKeysRequirement.required">"required"</a></code>.
</p></div>
</dd>
<dt id="cross-origin">Cross Origin Limitations</dt>
<dd>
<p>During playback, embedded media data is exposed to script in the embedding <a href="https://www.w3.org/TR/html51/browsers.html#concept-cross-origin">origin</a>.
In order for the API to provide <a href="#initialization-data">Initialization Data</a> in the <code><a href="#dom-evt-encrypted">encrypted</a></code> event, <a href="https://www.w3.org/TR/html51/semantics-embedded-content.html#media-data">media data</a> <em class="rfc2119" title="MUST">MUST</em> be <a href="https://www.w3.org/TR/html51/browsers.html#same-origin">CORS-same-origin</a> with the embedding page.
If <a href="https://www.w3.org/TR/html51/semantics-embedded-content.html#media-data">media data</a> is cross-origin with the embedding document, authors <em class="rfc2119" title="SHOULD">SHOULD</em> use the <code><a href="https://www.w3.org/TR/html51/semantics-embedded-content.html#element-attrdef-media-crossorigin">crossorigin</a></code> attribute
on the <code><a href="https://www.w3.org/TR/html51/semantics-embedded-content.html#htmlmediaelement-htmlmediaelement">HTMLMediaElement</a></code> and CORS headers on the <a href="https://www.w3.org/TR/html51/semantics-embedded-content.html#media-data">media data</a> response to make it <a href="https://www.w3.org/TR/html51/browsers.html#same-origin">CORS-same-origin</a>.
</p>
</dd>
<dt id="mixed-content">Mixed Content Limitations</dt>
<dd>
<p>During playback, embedded media data is exposed to script in the embedding <a href="https://www.w3.org/TR/html51/browsers.html#concept-cross-origin">origin</a>.
In order for the API to provide <a href="#initialization-data">Initialization Data</a> in the <code><a href="#dom-evt-encrypted">encrypted</a></code> event, <a href="https://www.w3.org/TR/html51/semantics-embedded-content.html#media-data">media data</a> <em class="rfc2119" title="MUST NOT">MUST NOT</em> be Mixed Content [<cite><a class="bibref" data-link-type="biblio" href="#bib-mixed-content" title="Mixed Content">MIXED-CONTENT</a></cite>].
</p>
</dd>
<dt id="time">Time</dt>
<dd>
<p>Time <em class="rfc2119" title="MUST">MUST</em> be equivalent to that represented in <a class="external" href="https://tc39.github.io/ecma262/#sec-time-values-and-time-range">ECMAScript <span class="estype">Time Values and Time Range</span></a> [<cite><a class="bibref" data-link-type="biblio" href="#bib-ecma-262" title="ECMAScript Language Specification">ECMA-262</a></cite>].
</p>
<p>Time will equal <code>NaN</code> if no such time exists or if the time is indeterminate. It should never have the value <code>Infinity</code>.
</p>
<div class="note" role="note" id="issue-container-generatedID-23"><div role="heading" class="note-title marker" id="h-note-23" aria-level="3"><span>Note</span></div><p class="">
Time generally represents an instant in time with millisecond accuracy; however, that alone is not a sufficient definition. The defined Time Values and Time Range reference adds other important requirements.
</p></div>
</dd>
<dt id="expiration-time">Expiration Time</dt>
<dd>
<p>
The <a href="#time">time</a> after which key(s) will no longer be <a href="#usable-for-decryption">usable for decryption</a>.
</p>
</dd>
<dt id="browsing-profile">Browsing Profile</dt>
<dd>
<p>
A User Agent on a given machine may support execution in a variety of different contexts or modes or temporary states that are expected to behave independently
with respect to application-visible state and data.
In particular, all stored data is expected to be independent. In this specification we refer to such independent contexts or modes as "Browsing Profiles".
</p>
<div class="note" role="note" id="issue-container-generatedID-24"><div role="heading" class="note-title marker" id="h-note-24" aria-level="3"><span>Note</span></div><p class="">
Examples of such independent contexts include if the user agent is running in different operating system user accounts or if the user agent provides the capability to define
multiple independent profiles for a single account.
</p></div>
</dd>
<dt id="valid-media-mime-type">Valid Media MIME Type</dt>
<dd>
<p>
A valid media MIME type is a media <a href="https://www.w3.org/TR/html51/semantics-embedded-content.html#mime-types">MIME type</a> that is also a <a href="https://www.w3.org/TR/html51/infrastructure.html#valid-mime-type">valid MIME type</a> [<cite><a class="bibref" data-link-type="biblio" href="#bib-html" title="HTML Standard">HTML</a></cite>].
When a MIME type includes parameters, such as <code>"codecs"</code> [<cite><a class="bibref" data-link-type="biblio" href="#bib-rfc6381" title="The 'Codecs' and 'Profiles' Parameters for "Bucket" Media Types">RFC6381</a></cite>], such parameters <em class="rfc2119" title="MUST">MUST</em> also be valid per the relevant specification.
</p>
<p>
When used with the features defined in this specification, MIME type strings <em class="rfc2119" title="SHOULD">SHOULD</em> explicitly specify codecs and codec constraints (e.g., per [<cite><a class="bibref" data-link-type="biblio" href="#bib-rfc6381" title="The 'Codecs' and 'Profiles' Parameters for "Bucket" Media Types">RFC6381</a></cite>]) unless these are normatively implied by the container.
</p>
</dd>
</dl>
</section>
<section id="obtaining-access-to-key-systems">
<h2 id="x3-obtaining-access-to-key-systems"><bdi class="secno">3. </bdi>Obtaining Access to Key Systems<a class="self-link" aria-label="§" href="#obtaining-access-to-key-systems"></a></h2>
<p>This section defines the mechanism for obtaining access to a key system.
The inclusion of capabilities in the request also enables feature detection.
</p>
<p>The steps of an algorithm are always aborted when rejecting a promise.</p>
<section id="feature-policy-integration">
<h3 id="x3-1-feature-policy-integration"><bdi class="secno">3.1 </bdi>Feature Policy Integration<a class="self-link" aria-label="§" href="#feature-policy-integration"></a></h3>
<p>
<code><a href="#dom-navigator-requestmediakeysystemaccess">requestMediaKeySystemAccess()</a></code> is a <a href="https://www.w3.org/TR/permissions-policy-1/#policy-controlled-feature">policy-controlled feature</a>
identified by the string <dfn data-dfn-type="dfn" id="dfn-encrypted-media"><code>encrypted-media</code></dfn>. Its <a href="https://www.w3.org/TR/permissions-policy-1/#default-allowlist">default allowlist</a> is <code>'self'</code>
[<cite><a class="bibref" data-link-type="biblio" href="#bib-feature-policy" title="Permissions Policy">FEATURE-POLICY</a></cite>].
</p>
</section>
<section id="navigator-extension-requestmediakeysystemaccess">
<h3 id="x3-2-navigator-extension-requestmediakeysystemaccess"><bdi class="secno">3.2 </bdi><dfn data-dfn-type="dfn" id="dom-navigator" data-idl="interface" data-title="Navigator" data-dfn-for=""><code>Navigator</code></dfn> Extension: <code>requestMediaKeySystemAccess()</code><a class="self-link" aria-label="§" href="#navigator-extension-requestmediakeysystemaccess"></a></h3>
<div><pre class="idl def" id="webidl-2126790292"><span class="idlHeader"><a class="self-link" href="#webidl-2126790292">WebIDL</a></span><span data-idl="" class="idlInterface" id="idl-def-navigator-partial-1" data-title="Navigator">[<span class="extAttr"><a data-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed">Exposed</a>=<a data-type="interface" href="https://html.spec.whatwg.org/multipage/window-object.html#window">Window</a></span>]
partial interface <a class="internalDFN idlID" data-link-type="interface" href="#dom-navigator"><code>Navigator</code></a> {<span data-idl="" class="idlMethod" id="idl-def-navigator-requestmediakeysystemaccess-keysystem-supportedconfigurations" data-title="requestMediaKeySystemAccess" data-dfn-for="Navigator">
[<span class="extAttr"><a data-type="extended-attribute" href="https://heycam.github.io/webidl/#SecureContext">SecureContext</a></span>]<span class="idlType"> <a data-type="interface" href="https://heycam.github.io/webidl/#idl-promise">Promise</a><<a href="#dom-mediakeysystemaccess" class="internalDFN" data-link-type="idl"><code>MediaKeySystemAccess</code></a>></span> <a class="internalDFN idlName" data-link-type="method" href="#dom-navigator-requestmediakeysystemaccess"><code>requestMediaKeySystemAccess</code></a> (<span class="idlType"><a data-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString">DOMString</a></span> <span class="idlParamName">keySystem</span>,<span class="idlType"> <a data-type="dfn" href="https://heycam.github.io/webidl/#idl-sequence">sequence</a><<a href="#dom-mediakeysystemconfiguration" class="internalDFN" data-link-type="idl"><code>MediaKeySystemConfiguration</code></a>></span> <span class="idlParamName">supportedConfigurations</span>);</span>
};</span></pre><section><h4 id="methods">Methods<a class="self-link" aria-label="§" href="#methods"></a></h4><dl class="methods" data-dfn-for="Navigator" data-link-for="Navigator"><dt><dfn data-dfn-type="method" data-export="" id="dom-navigator-requestmediakeysystemaccess" data-idl="operation" data-title="requestMediaKeySystemAccess" data-dfn-for="Navigator" data-type="Promise" data-lt="requestMediaKeySystemAccess()|requestMediaKeySystemAccess(keySystem, supportedConfigurations)" data-local-lt="Navigator.requestMediaKeySystemAccess|Navigator.requestMediaKeySystemAccess()|requestMediaKeySystemAccess"><code id="requestMediaKeySystemAccess">requestMediaKeySystemAccess</code></dfn></dt><dd>
<div class="note" role="note" id="issue-container-generatedID-25"><div role="heading" class="note-title marker" id="h-note-25" aria-level="5"><span>Note</span></div><p class="">Calling this method may have <em>user-visible effects</em>, including requests for user consent.
This method should only be called when the author intends to create and use a <a href="#dom-mediakeys" class="internalDFN" data-link-type="idl"><code>MediaKeys</code></a> object with the provided configuration.
</p></div>
<p>Requests access to the specified <a href="#key-system">Key System</a>.
When <code>supportedConfigurations</code> is specified, the configuration specified by at least one of its elements must be supported.
The resulting <a href="#dom-mediakeysystemaccess" class="internalDFN" data-link-type="idl"><code>MediaKeySystemAccess</code></a> will correspond to the first such element.
</p>
<p>Any permission checks or user interaction, such as a prompt for consent, <em class="rfc2119" title="MUST">MUST</em> be performed before resolving the promise.</p>
<p>If the <code>keySystem</code> is not supported or not allowed (in at least one of the <code>supportedConfigurations</code>, if specified), the promise is rejected.
Otherwise, it is resolved with a new <a href="#dom-mediakeysystemaccess" class="internalDFN" data-link-type="idl"><code>MediaKeySystemAccess</code></a> object.
</p>
<div class="note" role="note" id="issue-container-generatedID-26"><div role="heading" class="note-title marker" id="h-note-26" aria-level="5"><span>Note</span></div><div class="">
<p>This method is only exposed to <a href="https://www.w3.org/TR/secure-contexts/#secure-context">secure contexts</a> [<cite><a class="bibref" data-link-type="biblio" href="#bib-secure-contexts" title="Secure Contexts">SECURE-CONTEXTS</a></cite>] as indicated by the <code>[SecureContext]</code> IDL attribute.</p>
<p>
Requiring Secure Contexts is <em>not</em> a replacement for other security- and privacy-related requirements and recommendations.
Implementations <em class="rfc2119" title="MUST">MUST</em> meet all related requirements and <em class="rfc2119" title="SHOULD">SHOULD</em> follow related recommendations such that the risks on in an secure context would be similar.
</p>
</div></div>
<table class="parameters"><tbody><tr><th>Parameter</th><th>Type</th><th>Nullable</th><th>Optional</th><th>Description</th></tr><tr><td class="prmName">keySystem</td><td class="prmType"><code>DOMString</code></td><td class="prmNullFalse"><span role="img" aria-label="False">✘</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc">
The <a href="#key-system">Key System</a> for which access is being requested.
</td></tr><tr><td class="prmName">supportedConfigurations</td><td class="prmType"><code>sequence<MediaKeySystemConfiguration></code></td><td class="prmNullFalse"><span role="img" aria-label="False">✘</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc">
A sequence of <a href="#dom-mediakeysystemconfiguration" class="internalDFN" data-link-type="idl"><code>MediaKeySystemConfiguration</code></a> configurations to try in order.
The first element with a satisfiable configuration will be used.
</td></tr></tbody></table><div><em>Return type: </em><code>Promise<MediaKeySystemAccess></code></div><p>When this method is invoked, the user agent must run the following steps:</p><ol class="method-algorithm">
<li><p>If the <a href="https://www.w3.org/TR/permissions-policy-1/#responsible-document">responsible
document</a> is not <a href="https://www.w3.org/TR/permissions-policy-1/#allowed-to-use">allowed to use</a>
the <a href="#dfn-encrypted-media" class="internalDFN" data-link-type="dfn"><code><code>encrypted-media</code></code></a> feature, then throw a "<a href="https://heycam.github.io/webidl/#securityerror">SecurityError</a>" <a href="https://heycam.github.io/webidl/#dfn-DOMException">DOMException</a> and abort these steps.</p></li>
<li><p>If <var>keySystem</var> is the empty string, return a promise rejected with a newly created <code><a href="#dfn-TypeError">TypeError</a></code>.</p></li>
<li><p>If <var>supportedConfigurations</var> is empty, return a promise rejected with a newly created <code><a href="#dfn-TypeError">TypeError</a></code>.</p></li>
<li><p>Let <var>document</var> be the calling context's <a href="https://www.w3.org/TR/dom/#concept-document">Document</a>.</p></li>
<li><p>Let <var>origin</var> be the <a href="https://www.w3.org/TR/html51/browsers.html#concept-cross-origin">origin</a> of <var>document</var>.</p></li>
<li><p>Let <var>promise</var> be a new promise.</p></li>
<li><p>Run the following steps in parallel:</p>
<ol>
<li><p>If <var>keySystem</var> is not one of the <a href="#key-system">Key Systems</a> supported by the user agent, reject <var>promise</var> with a <code><a href="#dfn-NotSupportedError">NotSupportedError</a></code>. String comparison is case-sensitive.</p></li>
<li><p>Let <var>implementation</var> be the implementation of <var>keySystem</var>.</p></li>
<li><p>For each value in <code>supportedConfigurations</code>:</p>
<ol>
<li><p>Let <var>candidate configuration</var> be the value.</p></li>
<li><p>Let <var>supported configuration</var> be the result of executing the <a href="#get-supported-configuration">Get Supported Configuration</a> algorithm on <var>implementation</var>, <var>candidate configuration</var>, and <var>origin</var>.</p></li>
<li><p>If <var>supported configuration</var> is not <code>NotSupported</code>, run the following steps:</p>
<ol>
<li>
<p>Let <var>access</var> be a new <a href="#dom-mediakeysystemaccess" class="internalDFN" data-link-type="idl"><code>MediaKeySystemAccess</code></a> object, and initialize it as follows:</p>
<ol>
<li><p>Set the <code><a href="#dom-mediakeysystemaccess-keysystem">keySystem</a></code> attribute to <var>keySystem</var>.</p></li>
<li><p>Let the <var>configuration</var> value be <var>supported configuration</var>.</p></li>
<li><p>Let the <var>cdm implementation</var> value be <var>implementation</var>.</p></li>
</ol>
</li>
<li><p>Resolve <var>promise</var> with <var>access</var> and abort the parallel steps of this algorithm.</p></li>
</ol>
</li>
</ol>
</li>
<li><p>Reject <var>promise</var> with a <code><a href="#dfn-NotSupportedError">NotSupportedError</a></code>.</p>
<div class="note" role="note" id="issue-container-generatedID-27"><div role="heading" class="note-title marker" id="h-note-27" aria-level="5"><span>Note</span></div><p class=""><code>keySystem</code> was not supported/allowed or none of the configurations in <code>supportedConfigurations</code> were supported/allowed.</p></div>
</li>
</ol>
</li>
<li><p>Return <var>promise</var>.</p></li>
</ol></dd></dl></section></div>
<section id="algorithms">
<h4 id="x3-2-1-algorithms"><bdi class="secno">3.2.1 </bdi>Algorithms<a class="self-link" aria-label="§" href="#algorithms"></a></h4>
<section id="get-supported-configuration">
<h5 id="x3-2-1-1-get-supported-configuration"><bdi class="secno">3.2.1.1 </bdi>Get Supported Configuration<a class="self-link" aria-label="§" href="#get-supported-configuration"></a></h5>
<p>Given a <a href="#key-system">Key Systems</a> implementation <var>implementation</var>, <a href="#dom-mediakeysystemconfiguration" class="internalDFN" data-link-type="idl"><code>MediaKeySystemConfiguration</code></a> <var>candidate configuration</var>, and <var>origin</var>, this algorithm returns a supported configuration or <code>NotSupported</code> as appropriate.</p>
<div class="note" role="note" id="issue-container-generatedID-28"><div role="heading" class="note-title marker" id="h-note-28" aria-level="6"><span>Note</span></div><p class="">Unrecognized dictionary members in <var>candidate configuration</var> are ignored per [<cite><a class="bibref" data-link-type="biblio" href="#bib-webidl" title="Web IDL">WEBIDL</a></cite>] and will never reach this algorithm. Thus, they cannot be considered as part of the configuration.
</p></div>
<div class="note" role="note" id="issue-container-generatedID-29"><div role="heading" class="note-title marker" id="h-note-29" aria-level="6"><span>Note</span></div><div class="">
<p>
For certain configurations, it may be required to obtain user consent or inform the user. User Agents have some flexibility to determine
whether consent is required for a specific configuration and whether such consent may also apply to other configurations. For example,
consent to one configuration may also imply consent for less powerful, more restricted configurations. Equally, a denial of consent for
one configuration may imply denial of consent for more powerful, less restricted configurations.
</p>
<p>
Supported configurations, including supported audio and video codecs, may depend on availability of optional capabilities such as
<a href="#distinctive-identifier">Distinctive Identifier(s)</a> and persistent state. The following algorithm iteratively tries to find a configuration
that is both supported and has user consent (or does not need consent).
</p>
<p>
User Agents should reuse earlier consent responses, when appropriate, at least for the duration of the <code><a href="#dom-navigator-requestmediakeysystemaccess">requestMediaKeySystemAccess()</a></code>
algorithm in order to avoid repeated requests to the user for similar configurations.
</p>
<p>
The variable <var>restrictions</var> in the steps below represents the configurations for which consent has been denied during the
execution of this algorithm or based on persisted consent information for the origin. It is used to determine
whether user consent for a candidate configuration or accumulated configuration has been denied. Consent is denied for a accumulated configuration
if every derived configuration has already been denied. Internal representation of <var>restrictions</var> is implementation-specific.
</p>
</div></div>
<ol>
<li>
<p>Let <var>supported configuration</var> be <code>ConsentDenied</code>.</p>
</li>
<li>
<p>Initialize <var>restrictions</var> to indicate that no configurations have had user consent denied.</p>
</li>
<li>
<p>Repeat the following step while <var>supported configuration</var> is <code>ConsentDenied</code>:</p>
<ol>
<li>
<p>
Let <var>supported configuration</var> and, if provided, <var>restrictions</var> be the result of executing the
<a href="#get-supported-configuration-and-consent">Get Supported Configuration and Consent</a> algorithm
with <var>implementation</var>, <var>candidate configuration</var>, <var>restrictions</var> and <var>origin</var>.
</p>
</li>
</ol>
</li>
<li>
<p>Return <var>supported configuration</var>.</p>
</li>
</ol>
</section>
<section id="get-supported-configuration-and-consent">
<h5 id="x3-2-1-2-get-supported-configuration-and-consent"><bdi class="secno">3.2.1.2 </bdi>Get Supported Configuration and Consent<a class="self-link" aria-label="§" href="#get-supported-configuration-and-consent"></a></h5>
<p>Given a <a href="#key-system">Key Systems</a> implementation <var>implementation</var>, <a href="#dom-mediakeysystemconfiguration" class="internalDFN" data-link-type="idl"><code>MediaKeySystemConfiguration</code></a> <var>candidate configuration</var>,
<var>restrictions</var> and <var>origin</var>, this algorithm returns a supported configuration, <code>NotSupported</code>, or <code>ConsentDenied</code> as appropriate and, in the <code>ConsentDenied</code> case, <var>restrictions</var>.
</p>
<ol>
<li><p>Let <var>accumulated configuration</var> be a new <a href="#dom-mediakeysystemconfiguration" class="internalDFN" data-link-type="idl"><code>MediaKeySystemConfiguration</code></a> dictionary.</p></li>
<li>
<p>
Set the <code><a href="#dom-mediakeysystemconfiguration-label">label</a></code> member of <var>accumulated configuration</var> to equal the <code><a href="#dom-mediakeysystemconfiguration-label">label</a></code> member of <var>candidate configuration</var>.
</p>
</li>
<li><p>If the <code><a href="#dom-mediakeysystemconfiguration-initdatatypes">initDataTypes</a></code> member of <var>candidate configuration</var> is non-empty, run the following steps:</p>
<ol>
<li><p>Let <var>supported types</var> be an empty sequence of DOMStrings.</p></li>
<li><p>For each value in <var>candidate configuration</var>'s <code><a href="#dom-mediakeysystemconfiguration-initdatatypes">initDataTypes</a></code> member:</p>
<ol>
<li><p>Let <var>initDataType</var> be the value.</p></li>
<li>
<p>If the <var>implementation</var> supports generating requests based on <var>initDataType</var>, add <var>initDataType</var> to <var>supported types</var>.
String comparison is case-sensitive.
The empty string is never supported.
</p>
<div class="note" role="note" id="issue-container-generatedID-30"><div role="heading" class="note-title marker" id="h-note-30" aria-level="6"><span>Note</span></div><p class="">The <var>initDataType</var> <em class="rfc2119" title="MUST">MUST</em> be supported independent of content types in order to avoid unexpectedly rejecting the configuration in later steps.
Support for <var>initDataType</var> includes both license generation and, when appropriate, extraction from media data.
See <a href="#initialization-data-type-support-requirements">Initialization Data Type Support requirements</a>.
</p></div>
</li>
</ol>
</li>
<li><p>If <var>supported types</var> is empty, return <code>NotSupported</code>.</p></li>
<li><p>Set the <code><a href="#dom-mediakeysystemconfiguration-initdatatypes">initDataTypes</a></code> member of <var>accumulated configuration</var> to <var>supported types</var>.</p></li>
</ol>
</li>
<li>
<p>
Let <var>distinctive identifier requirement</var> be the value of <var>candidate configuration</var>'s <code><a href="#dom-mediakeysystemconfiguration-distinctiveidentifier">distinctiveIdentifier</a></code> member.
</p>
</li>
<li>
<p>
If <var>distinctive identifier requirement</var> is <code><a href="#idl-def-MediaKeysRequirement.optional">"optional"</a></code> and
<a href="#distinctive-identifier">Distinctive Identifiers</a> are not allowed according to <var>restrictions</var>, set <var>distinctive identifier requirement</var>
to <code><a href="#idl-def-MediaKeysRequirement.not-allowed">"not-allowed"</a></code>.
</p>