Bug 1915045 Ensure decode tasks are scheduled on BufferingState::Enter() r=media...
[gecko.git] / dom / canvas / test / reftest / capturestream.html
blobb07ab394bc8ee9a464b6016f171acf8022a0618a
1 <!DOCTYPE html>
2 <meta charset='UTF-8'>
3 <!--
4 Clear the canvas to green and capture it to a stream to test that we can get
5 the stream to screen in a local video element.
6 -->
7 <html class="reftest-wait">
9 <head>
10 <script type='text/javascript'>
11 function finished() {
12 document.documentElement.removeAttribute("class");
15 function runTest() {
16 var canvas = document.getElementById('canvas');
17 var context = canvas.getContext('2d');
18 context.fillStyle = "rgba(0, 255, 0, 1)";
19 context.fillRect(0, 0, canvas.width, canvas.height);
21 var video = document.getElementById('video');
22 video.srcObject = canvas.captureStream(0);
23 video.play();
24 video.onloadeddata = finished;
25 video.onerror = finished;
27 </script>
28 </head>
30 <body onload='runTest();'>
31 <video id='video' width='256' height='256'></video>
32 <canvas id='canvas' width='256' height='256' style="display:none"></canvas>
33 </body>
35 </html>