OLD | NEW |
---|---|
(Empty) | |
1 <!DOCTYPE html> | |
2 <html> | |
3 <head> | |
4 <meta charset=utf-8> | |
5 <title>Media Capture from DOM Elements IDL test</title> | |
6 <link rel="help" href="https://w3c.github.io/mediacapture-fromelement/"> | |
7 <script src="/resources/testharness.js"></script> | |
8 <script src="/resources/testharnessreport.js"></script> | |
9 <script src="/resources/WebIDLParser.js"></script> | |
10 <script src="/resources/idlharness.js"></script> | |
11 </head> | |
12 <body> | |
13 <media id='media' width=10 height=10/> | |
14 <canvas id='canvas' width=10 height=10/> | |
15 | |
16 <pre id="untested_idl" style="display: none"> | |
17 interface HTMLCanvasElement {}; | |
18 interface HTMLMediaElement {}; | |
19 interface MediaStream {}; | |
20 interface MediaStreamTrack {}; | |
21 </pre> | |
22 <pre id="idl" style="display: none"> | |
23 // https://w3c.github.io/mediacapture-fromelement/ | |
24 | |
25 partial interface HTMLMediaElement { | |
26 MediaStream captureStream(); | |
27 }; | |
28 | |
29 partial interface HTMLCanvasElement { | |
30 MediaStream captureStream(optional double frameRequestRate); | |
31 }; | |
32 | |
33 interface CanvasCaptureMediaStreamTrack : MediaStreamTrack { | |
34 readonly attribute HTMLCanvasElement canvas; | |
35 void requestFrame(); | |
36 }; | |
37 | |
38 </pre> | |
39 <script> | |
40 var canvas = document.getElementById('canvas'); | |
41 var media = document.getElementById('media'); | |
42 | |
43 var idl_array = new IdlArray(); | |
44 idl_array.add_untested_idls(document.getElementById("untested_idl").textCont ent); | |
45 idl_array.add_idls(document.getElementById("idl").textContent); | |
46 idl_array.add_objects({ | |
47 HTMLMediaElement: [media], | |
48 HTMLCanvasElement: [canvas], | |
49 CanvasCaptureMediaStreamTrack: [canvas.captureStream().getTracks()[0]], | |
Reilly Grant (use Gerrit)
2017/03/20 18:03:31
If you want to test the capture streams generated
mcasas
2017/03/20 18:17:55
I could but since we're ignoring (l.19) the testin
| |
50 }); | |
51 idl_array.test(); | |
52 </script> | |
53 <div id="log"></div> | |
54 </body> | |
55 </html> | |
OLD | NEW |