5 <script src=media-file.js
></script>
6 <script src=video-test.js
></script>
16 // should not buffer, 'preload' is 'none'
20 playInsteadOfLoad
: false,
21 description
: "until 'play()' is called",
24 // should buffer, because load() is called.
28 playInsteadOfLoad
: false,
29 description
: "because 'load()' is called",
32 // should buffer, because play() is called.
36 playInsteadOfLoad
: true,
37 description
: "because 'play()' is called",
43 playInsteadOfLoad
: false,
50 playInsteadOfLoad
: false,
54 // should buffer because 'autoplay' is set
58 playInsteadOfLoad
: false,
59 description
: " because of 'autoplay'",
67 var movie
= movieInfo
.movies
[movieInfo
.current
];
69 logResult(true, "did not buffer automatically");
71 // start playback, which should force data to load
72 movie
.shouldBuffer
= true;
76 function loadedmetadata()
78 var movie
= movieInfo
.movies
[movieInfo
.current
];
81 logResult(movie
.shouldBuffer
, "buffered automatically");
85 function setupAttribute(attr
, value
)
88 run("video.setAttribute('" + attr
+ "', '" + value
+ "')");
90 run("video.removeAttribute('" + attr
+ "')");
93 function openNextMovie()
98 if (movieInfo
.current
>= movieInfo
.movies
.length
)
104 var movie
= movieInfo
.movies
[movieInfo
.current
];
105 var url
= findMediaFile("video", "content/test");
106 var desc
= "Will load with <em>'preload=" + movie
.preload
+ "'</em>"
107 + ", <b>should" + (movie
.shouldBuffer
? "" : " not") + " </b> buffer automatically "
111 setupAttribute('preload', movie
.preload
);
112 setupAttribute('autoplay', movie
.autoPlay
);
115 if (movieInfo
.current
> 0) {
116 if (movie
.playInsteadOfLoad
) {
122 if (!movie
.shouldBuffer
)
123 timer
= setTimeout(checkLoad
, 200);
130 waitForEvent("error");
131 waitForEvent("loadstart");
132 waitForEvent("play");
133 waitForEvent('loadedmetadata', loadedmetadata
);
141 <body onload=
"start()">
142 <p>Test to see if media loads automatically when 'preload' is specified.
</p>
143 <video controls
></video>