3 This test checks that video tags created by javascript are are deferred
4 during prerendering and the autoplay is enabled during swap ins.
7 <title>Prerender for HTML5 Media Source Video.
</title>
11 <video id=
"mediaEl" autoplay controls
></video>
15 var testNetworkEvents
= false;
18 <script src=
"prerender_html5_common.js"></script>
22 function onSourceOpen(e
) {
23 var srcBuffer
= mediaSource
.addSourceBuffer('video/webm; codecs="vp8"');
24 var xhr
= new XMLHttpRequest();
25 xhr
.open('GET', 'bear-320x240-video-only.webm');
26 xhr
.responseType
= 'arraybuffer';
27 xhr
.addEventListener('load', function(e
) {
28 srcBuffer
.appendBuffer(new Uint8Array(e
.target
.response
));
29 srcBuffer
.addEventListener('updateend', function(e
) {
30 mediaSource
.endOfStream();
36 var mediaSource
= new MediaSource();
37 mediaSource
.addEventListener('sourceopen', onSourceOpen
);
38 mediaEl
.src
= window
.URL
.createObjectURL(mediaSource
);