OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head> |
| 4 <script src="../media-file.js"></script> |
| 5 <script src="../video-test.js"></script> |
| 6 <script> |
| 7 function onLoad() |
| 8 { |
| 9 if (window.testRunner) |
| 10 testRunner.dumpAsText(); |
| 11 |
| 12 var cueDuration = 0.1; |
| 13 var video = document.querySelector("#vid"); |
| 14 var track = video.addTextTrack("subtitles"); |
| 15 track.mode = "disabled"; |
| 16 |
| 17 for (var i = 0; i < 10; ++i) { |
| 18 var start = i * cueDuration; |
| 19 var end = start + cueDuration; |
| 20 track.addCue(new TextTrackCue(start, end, "Test Cue " + i)); |
| 21 } |
| 22 |
| 23 consoleWrite("Waiting for 2 cue durations to elapse."); |
| 24 |
| 25 video.addEventListener('timeupdate', function (e) |
| 26 { |
| 27 if (e.target.currentTime < 2 * cueDuration) |
| 28 return; |
| 29 |
| 30 // End test after at least 2 cueDurations to make sure the
test |
| 31 // doesn't crash during the period the first 2 cues would
have been |
| 32 // rendered if the track was not disabled. |
| 33 consoleWrite("2 cue durations have elapsed."); |
| 34 endTest(); |
| 35 }); |
| 36 video.play(); |
| 37 } |
| 38 </script> |
| 39 </head> |
| 40 <body onload="onLoad()"> |
| 41 <p>Test adding cues to a disabled text track. </p> |
| 42 <video id="vid" src="../content/test.ogv" controls></video> |
| 43 </body> |
| 44 </html> |
OLD | NEW |