| <!DOCTYPE html> |
| <html> |
| <head> |
| <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
| |
| <script src=../media-file.js></script> |
| <script src=../video-test.js></script> |
| <script> |
| |
| function trackLoaded() |
| { |
| consoleWrite("EVENT(load) -- <track>"); |
| consoleWrite("<i>**check metadata track state<" + "/i>"); |
| testExpected("track.readyState", HTMLTrackElement.LOADED); |
| testExpected("track.track.mode", "hidden"); |
| testExpected("video.textTracks[0].cues.length", 12); |
| testExpected("video.textTracks[0].cues[11].startTime", 22); |
| consoleWrite(""); |
| endTest(); |
| } |
| |
| function canplaythrough() |
| { |
| consoleWrite("EVENT(canplaythrough) -- <video>"); |
| consoleWrite("<i>**change metadata track mode so it loads<" + "/i>"); |
| testExpected("track.readyState", HTMLTrackElement.NONE); |
| testExpected("video.textTracks[0].mode", "disabled"); |
| testExpected("video.textTracks[0].cues", null); |
| run("video.textTracks[0].mode = 'hidden'"); |
| consoleWrite(""); |
| } |
| |
| function start() |
| { |
| consoleWrite("<br>EVENT(load) -- <body>"); |
| findMediaElement(); |
| |
| consoleWrite("<i>**check initial metadata track state<" + "/i>"); |
| track = document.querySelectorAll('track')[0]; |
| testExpected("track.readyState", HTMLTrackElement.NONE); |
| testExpected("video.textTracks[0].mode", "disabled"); |
| |
| video.src = findMediaFile("video", "../content/test"); |
| consoleWrite(""); |
| } |
| </script> |
| </head> |
| |
| <body onload="start()"> |
| <p>Tests that a 'metadata' track does not load automatically, but does load when the mode is changed.</p> |
| <video oncanplaythrough="canplaythrough()" > |
| <track kind="metadata" src="captions-webvtt/metadata.vtt" onload="trackLoaded()"> |
| </video> |
| </body> |
| </html> |