| <!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> |
| |
| numberOfTrackTests = 3; |
| |
| function trackLoaded() |
| { |
| numberOfTracksLoaded++; |
| if (numberOfTracksLoaded == numberOfTrackTests) { |
| testTrack(0); |
| testTrack(1); |
| testTrackError(2); |
| } |
| } |
| |
| function testTrack(i) |
| { |
| findMediaElement(); |
| var expected = |
| { |
| length : 2, |
| tests: |
| [ |
| { |
| property : "id", |
| values : [1, 2], |
| }, |
| { |
| property : "startTime", |
| values : [0.0, 31.0], |
| }, |
| { |
| property : "endTime", |
| values : [30.5, 1200.5], |
| }, |
| { |
| property : "text", |
| values : ["Bear is Coming!!!!!", "I said Bear is coming!!!!"], |
| }, |
| ], |
| }; |
| testCues(i, expected); |
| |
| allTestsEnded(); |
| } |
| |
| function testTrackError(i) |
| { |
| findMediaElement(); |
| var expected = |
| { |
| length : 0, |
| tests: |
| [], |
| }; |
| testCues(i, expected); |
| |
| allTestsEnded(); |
| } |
| </script> |
| </head> |
| <body onload="enableAllTextTracks()"> |
| <p>Tests that the magic file header "WEBVTT" leads to the file properly recognized as a WebVTT file.</p> |
| <video> |
| <track src="captions-webvtt/tc004-webvtt-file.vtt" onload="trackLoaded()"> |
| <track src="captions-webvtt/tc004-webvtt-rubbish.vtt" onload="trackLoaded()"> |
| <track src="captions-webvtt/tc004-no-webvtt.vtt" onerror="trackLoaded()"> |
| </video> |
| </body> |
| </html> |