OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <meta charset="utf-8"> | 4 <meta charset="utf-8"> |
5 <title>Media Capabilities IDL tests</title> | 5 <title>Media Capabilities IDL tests</title> |
6 <link rel="help" href="https://wicg.github.io/media-capabilities/"/> | 6 <link rel="help" href="https://wicg.github.io/media-capabilities/"/> |
7 <script src="/resources/testharness.js"></script> | 7 <script src="/resources/testharness.js"></script> |
8 <script src="/resources/testharnessreport.js"></script> | 8 <script src="/resources/testharnessreport.js"></script> |
9 <script src="/resources/WebIDLParser.js"></script> | 9 <script src="/resources/WebIDLParser.js"></script> |
10 <script src="/resources/idlharness.js"></script> | 10 <script src="/resources/idlharness.js"></script> |
(...skipping 14 matching lines...) Expand all Loading... |
25 <pre id='idl'> | 25 <pre id='idl'> |
26 dictionary MediaConfiguration { | 26 dictionary MediaConfiguration { |
27 required MediaConfigurationType type; | 27 required MediaConfigurationType type; |
28 | 28 |
29 VideoConfiguration video; | 29 VideoConfiguration video; |
30 AudioConfiguration audio; | 30 AudioConfiguration audio; |
31 }; | 31 }; |
32 | 32 |
33 enum MediaConfigurationType { | 33 enum MediaConfigurationType { |
34 "file", | 34 "file", |
35 "MediaSource", | 35 "media-source", |
36 }; | 36 }; |
37 | 37 |
38 dictionary VideoConfiguration { | 38 dictionary VideoConfiguration { |
39 required DOMString type; | 39 required DOMString contentType; |
40 required unsigned long width; | 40 required unsigned long width; |
41 required unsigned long height; | 41 required unsigned long height; |
42 required unsigned long bitrate; | 42 required unsigned long bitrate; |
43 required double framerate; | 43 required double framerate; |
44 }; | 44 }; |
45 | 45 |
46 dictionary AudioConfiguration { | 46 dictionary AudioConfiguration { |
47 required DOMString type; | 47 required DOMString contentType; |
48 DOMString channels; | 48 DOMString channels; |
49 unsigned long bitrate; | 49 unsigned long bitrate; |
50 unsigned long samplerate; | 50 unsigned long samplerate; |
51 }; | 51 }; |
52 | 52 |
53 interface MediaDecodingAbility { | 53 interface MediaDecodingAbility { |
54 readonly attribute boolean supported; | 54 readonly attribute boolean supported; |
55 readonly attribute boolean smooth; | 55 readonly attribute boolean smooth; |
56 readonly attribute boolean powerEfficient; | 56 readonly attribute boolean powerEfficient; |
57 }; | 57 }; |
58 | 58 |
59 [Exposed=(Window)] | 59 [Exposed=(Window)] |
60 partial interface Navigator { | 60 partial interface Navigator { |
61 readonly attribute MediaCapabilities mediaCapabilities; | 61 [SameObject] readonly attribute MediaCapabilities mediaCapabilities; |
62 }; | 62 }; |
63 | 63 |
64 [Exposed=(Worker)] | 64 [Exposed=(Worker)] |
65 partial interface WorkerNavigator { | 65 partial interface WorkerNavigator { |
66 readonly attribute MediaCapabilities mediaCapabilities; | 66 [SameObject] readonly attribute MediaCapabilities mediaCapabilities; |
67 }; | 67 }; |
68 | 68 |
69 [Exposed=(Window, Worker)] | 69 [Exposed=(Window, Worker)] |
70 interface MediaCapabilities { | 70 interface MediaCapabilities { |
71 Promise<MediaDecodingAbility> query(MediaConfiguration configuration); | 71 Promise<MediaDecodingAbility> query(MediaConfiguration configuration); |
72 }; | 72 }; |
73 </pre> | 73 </pre> |
74 <script> | 74 <script> |
75 var idl_array = new IdlArray(); | 75 var idl_array = new IdlArray(); |
76 idl_array.add_untested_idls(document.getElementById("untested_idl").textContent)
; | 76 idl_array.add_untested_idls(document.getElementById("untested_idl").textContent)
; |
77 idl_array.add_idls(document.getElementById("idl").textContent); | 77 idl_array.add_idls(document.getElementById("idl").textContent); |
78 idl_array.add_objects({ | 78 idl_array.add_objects({ |
79 Navigator: ["navigator"] | 79 Navigator: ["navigator"] |
80 }); | 80 }); |
81 idl_array.test(); | 81 idl_array.test(); |
82 </script> | 82 </script> |
83 <div id="log"></div> | 83 <div id="log"></div> |
84 </body> | 84 </body> |
85 </html> | 85 </html> |
OLD | NEW |