3 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
4 <title>closed caption API test</title>
6 <script src=video-test.js></script>
7 <script src=media-fullscreen.js></script>
16 url : "content/test.wav",
17 description : "Audio-only file without captions",
21 url : "content/counting-captioned.mov",
22 description : "QuickTime movie with captions.",
29 function canplaythrough()
31 var movie = movieInfo.movies[movieInfo.current];
33 testExpected("mediaElement.webkitHasClosedCaptions", movie.hasCaptions);
34 testExpected("mediaElement.webkitClosedCaptionsVisible", false);
36 // Try to enable captions, they should only be enabled after if the movie has captions.
37 consoleWrite("*** enabling captions");
38 mediaElement.webkitClosedCaptionsVisible = true;
39 testExpected("mediaElement.webkitClosedCaptionsVisible", movie.hasCaptions);
44 function openNextMovie()
49 if (movieInfo.current >= movieInfo.movies.length)
55 var url = movieInfo.movies[movieInfo.current].url;
57 var desc = "<b>Loading</b> <em>\""+ url + "\"</em>" +
58 ". " + movieInfo.movies[movieInfo.current].description + ".</em>";
60 if (movieInfo.current > 0)
68 waitForEvent("error");
69 waitForEvent("loadstart");
70 waitForEvent("waiting");
71 waitForEvent("ratechange");
72 waitForEvent("durationchange");
73 waitForEvent("pause");
75 waitForEvent("playing");
77 waitForEvent('loadedmetadata', canplaythrough);
79 consoleWrite("<b>Test before movie is open:</b>");
80 testExpected("mediaElement.webkitHasClosedCaptions", false);
81 testExpected("mediaElement.webkitClosedCaptionsVisible", false);
90 <body onload="start()">
92 <video controls></video>
94 <p>Test media element close caption API.</p>