| <!DOCTYPE html> |
| <html> |
| <head> |
| <script src="../media-file.js"></script> |
| <script src="../video-test.js"></script> |
| <script> |
| function onLoad() |
| { |
| findMediaElement(); |
| video.src = findMediaFile('video', '../content/test'); |
| |
| var cueDuration = 0.1; |
| var track = video.addTextTrack("subtitles"); |
| track.mode = "disabled"; |
| |
| for (var i = 0; i < 10; ++i) { |
| var start = i * cueDuration; |
| var end = start + cueDuration; |
| track.addCue(new VTTCue(start, end, "Test Cue " + i)); |
| } |
| |
| consoleWrite("Waiting for 2 cue durations to elapse."); |
| |
| video.addEventListener('timeupdate', function (e) |
| { |
| if (e.target.currentTime < 2 * cueDuration) |
| return; |
| |
| // End test after at least 2 cueDurations to make sure the test |
| // doesn't crash during the period the first 2 cues would have been |
| // rendered if the track was not disabled. |
| consoleWrite("2 cue durations have elapsed.<br>"); |
| endTest(); |
| }); |
| video.play(); |
| } |
| |
| </script> |
| </head> |
| |
| <body onload="onLoad()"> |
| <p>Test adding cues to a disabled text track. </p> |
| <video id="vid" controls></video> |
| </body> |
| </html> |