Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / test / data / prerender / prerender_html5_video_media_source.html
blobd2272a57fe962cbaaba69021bd505874f0db1423
1 <html>
2 <!--
3 This test checks that video tags created by javascript are are deferred
4 during prerendering and the autoplay is enabled during swap ins.
5 -->
6 <head>
7 <title>Prerender for HTML5 Media Source Video.</title>
8 </head>
10 <body>
11 <video id="mediaEl" autoplay controls></video>
13 <script>
14 var willPlay = true;
15 var testNetworkEvents = false;
16 </script>
18 <script src="prerender_html5_common.js"></script>
20 <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.append(new Uint8Array(e.target.response));
29 mediaSource.endOfStream();
30 });
31 xhr.send();
34 var mediaSource = new WebKitMediaSource();
35 mediaSource.addEventListener('webkitsourceopen', onSourceOpen);
36 mediaEl.src = window.URL.createObjectURL(mediaSource);
37 </script>
39 </body>
40 </html>