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' src='webgl-utils.js'
></script>
11 <script type='text/javascript'
>
14 function setStatus(text
) {
15 var elem
= document
.getElementById('status');
16 elem
.innerHTML
= text
;
20 document
.documentElement
.removeAttribute("class");
24 var canvas
= document
.getElementById('canvas');
26 var gl
= initGL(canvas
);
28 setStatus('WebGL context creation failed.');
32 gl
.clearColor(0.0, 1.0, 0.0, 1.0);
33 gl
.clear(gl
.COLOR_BUFFER_BIT
);
35 var video
= document
.getElementById('video');
36 video
.srcObject
= canvas
.captureStream(0);
38 video
.onloadeddata
= finished
;
39 video
.onerror
= finished
;
44 <body onload='runTest();'
>
45 <video id='video' width='
256' height='
256'
></video>
46 <canvas id='canvas' width='
256' height='
256'
style=
"display:none"></canvas>
47 <div id='status'
></div>