OLD | NEW |
---|---|
(Empty) | |
1 <!DOCTYPE html> | |
2 <html> | |
3 <script src="../../resources/js-test.js"></script> | |
4 <body> | |
5 <script type="text/javascript"> | |
6 description("Test EME permission callbacks in WebView"); | |
timvolodine
2016/04/13 14:51:24
permission callback testing is probably not the ma
Yoland Yan(Google)
2016/04/26 02:03:57
Done.
| |
7 window.jsTestIsAsync = true; | |
8 | |
9 // https://w3c.github.io/encrypted-media/#requestMediaKeySystemAccess | |
10 // Tries multiple configuration per key system. The configurations are in | |
11 // descending order of privileges such that a supported permission-requiri ng | |
12 // configuration should be attempted before a configuration that does not | |
13 // require permissions. | |
timvolodine
2016/04/13 14:51:24
please update the comment as it does not apply
Yoland Yan(Google)
2016/04/26 02:03:58
Done.
| |
14 | |
15 // TODO(yolandyan) Look into whehther more key system need to be added | |
16 var chromeKeySystem = "com.widevine.alpha" | |
17 | |
18 var tryKeySystem = function(keySystem) { | |
19 console.log("keySystem is " + keySystem); | |
timvolodine
2016/04/13 14:51:24
debug instead console.log
Yoland Yan(Google)
2016/04/26 02:03:58
Done.
| |
20 navigator.requestMediaKeySystemAccess( | |
21 keySystem, | |
22 [ | |
23 { distinctiveIdentifier: "required", | |
24 persistentState: "required", | |
25 label: "'distinctiveIdentifier' and 'persistentState' required" | |
26 }, | |
27 { distinctiveIdentifier: "required", | |
28 label: "'distinctiveIdentifier' required" | |
29 }, | |
30 { persistentState: "required", | |
31 label: "'persistentState' required" | |
32 }, | |
33 { label: "empty" } | |
34 ] | |
35 ).then( | |
36 function (mediaKeySystemAccess) { | |
37 console.log("eme success"); | |
timvolodine
2016/04/13 14:51:24
-> debug(..)
timvolodine
2016/04/13 14:51:24
nit: eme -> EME
Yoland Yan(Google)
2016/04/26 02:03:57
Done.
Yoland Yan(Google)
2016/04/26 02:03:58
Done.
| |
38 finishJSTest(); | |
39 }, | |
40 function (error) { | |
41 debug("onError: code" + error.code + ", message=" + error.message); | |
42 finishJSTest(); | |
43 } | |
44 ); | |
45 }; | |
46 | |
47 tryKeySystem(chromeKeySystem); | |
48 </script> | |
49 </body> | |
50 </html> | |
OLD | NEW |