3 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
4 <title><video> and <source> error test</title>
5 <script src=video-test.js></script>
11 var expectedErrorCount = 5;
13 function errorEvent(evt)
18 for (ndx = 0; ndx < sources.length; ndx++) {
19 if (sources[ndx] == evt.target)
23 var src = sources[ndx].getAttribute('src') == null ? "null" : "'" + relativeURL(evt.target.src) + "'";
24 if (sources[ndx] == evt.target)
25 logResult(true, "EVENT(error) from <source id='<em>" + evt.target.id + "</em>' src=<em>" + src + "</em>>");
27 logResult(false, "EVENT(error) from " + evt.target);
29 testExpected("video.error", null);
31 if (++errorCount == expectedErrorCount) {
33 setTimeout(endTest, 200);
39 document.addEventListener("error", errorEvent, true);
41 sources = document.getElementsByTagName('source');
50 <video onloadstart="start()" controls>
51 <source id=missing-src type="video/blahblah">
52 <source id=bogus-type src=content/test.mp4 type="video/blahblah">
53 <source id=unsupported-media-query src=content/test.mp4 media=print>
54 <source id=empty-src src="" type="video/mp4">
55 <source id=no-extension-no-type src=nonexistent>
58 <p>Test that 'error' events are fired from <source> element when it can not be used.</p>