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.
7 <html class=
"reftest-wait">
10 <script type='text/javascript'
>
12 document
.documentElement
.removeAttribute("class");
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);
24 video
.onloadeddata
= finished
;
25 video
.onerror
= finished
;
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>