7 background-color: black;
10 #table { display: table; }
11 #table
> div { display: table-row; }
12 #table
> div
> div { display: table-cell; }
15 <body onload=
"main()">
16 <div id=
"buttons"></div>
20 <div id=
"video_header"></div>
23 <div><img src=
"blackwhite.png"></div>
24 <div><video autoplay
></video></div>
29 TODO(scherkus): Expand this test to use
<canvas
> to verify
30 pixel values. For now we only test playability.
34 function loadVideo(name
) {
35 var videoElem
= document
.querySelector('video');
36 videoElem
.src
= 'blackwhite_' + name
;
38 var headerElem
= document
.getElementById('video_header');
39 headerElem
.textContent
= name
;
42 function onVideoEvent(e
) {
43 document
.title
= e
.type
.toUpperCase();
47 // Programatically create buttons for each clip for manual testing.
48 var buttonsElem
= document
.getElementById('buttons');
50 function createButton(name
) {
51 var buttonElem
= document
.createElement('button');
52 buttonElem
.textContent
= name
;
53 buttonElem
.addEventListener('click', function() {
56 buttonsElem
.appendChild(buttonElem
);
71 for (var i
= 0; i
< VIDEOS
.length
; ++i
) {
72 createButton(VIDEOS
[i
]);
75 // Video event handlers.
76 var videoElem
= document
.querySelector('video');
77 videoElem
.addEventListener('error', onVideoEvent
);
78 videoElem
.addEventListener('ended', onVideoEvent
);
80 // Check if a query parameter was provided for automated tests.
81 if (window
.location
.search
.length
> 1) {
82 loadVideo(window
.location
.search
.substr(1));