5 <script src=media-file.js></script>
6 <script src=video-test.js></script>
16 // should not buffer, 'preload' is 'none'
20 description : "until 'play()' is called",
35 // should buffer because 'autoplay' is set
39 description : " because of 'autoplay'",
47 var movie = movieInfo.movies[movieInfo.current];
49 logResult(true, "did not buffer automatically");
51 // start playback, which should force data to load
52 movie.shouldBuffer = true;
56 function loadedmetadata()
58 var movie = movieInfo.movies[movieInfo.current];
61 logResult(movie.shouldBuffer, "buffered automatically");
65 function setupAttribute(attr, value)
68 run("video.setAttribute('" + attr + "', '" + value + "')");
70 run("video.removeAttribute('" + attr + "')");
73 function openNextMovie()
78 if (movieInfo.current >= movieInfo.movies.length)
84 var movie = movieInfo.movies[movieInfo.current];
85 var url = findMediaFile("video", "content/test");
86 var desc = "Will load with <em>'preload=" + movie.preload + "'</em>"
87 + ", <b>should" + (movie.shouldBuffer ? "" : " not") + " </b> buffer automatically "
91 setupAttribute('preload', movie.preload);
92 setupAttribute('autoplay', movie.autoPlay);
95 if (movieInfo.current > 0)
97 if (!movie.shouldBuffer)
98 timer = setTimeout(checkLoad, 200);
105 waitForEvent("error");
106 waitForEvent("loadstart");
107 waitForEvent("play");
108 waitForEvent('loadedmetadata', loadedmetadata);
116 <body onload="start()">
117 <p>Test to see if media loads automatically when 'preload' is specified.</p>
118 <video controls ></video>