OLD | NEW |
| (Empty) |
1 <!DOCTYPE html> | |
2 <html> | |
3 <head> | |
4 <title>In-band tracks enabled/disabled with legacy API</title> | |
5 | |
6 <script src=../media-file.js></script> | |
7 <script src=../video-test.js></script> | |
8 <script src=../media-controls.js></script> | |
9 <script> | |
10 | |
11 function seeked() | |
12 { | |
13 consoleWrite("<br><i>** Test to make sure captions are displayin
g<" + "/i>"); | |
14 | |
15 testExpected("inbandTrack1.cues", null, '!='); | |
16 testExpected("textTrackDisplayElement(video, 'cue').textContent"
, null, '!='); | |
17 | |
18 consoleWrite("<br><i>** Disable captions, cues should be flushed
<" + "/i>"); | |
19 run("video.webkitClosedCaptionsVisible = false"); | |
20 testExpected("inbandTrack1.cues", null); | |
21 | |
22 consoleWrite(""); | |
23 endTest(); | |
24 } | |
25 | |
26 function canplaythrough() | |
27 { | |
28 consoleWrite("<br><i>** Check initial in-band track states<" + "
/i>"); | |
29 testExpected("video.textTracks.length", 1); | |
30 run("inbandTrack1 = video.textTracks[0]"); | |
31 testExpected("inbandTrack1.mode", "disabled"); | |
32 testExpected("inbandTrack1.cues", null); | |
33 testExpected("inbandTrack1.language", "en"); | |
34 testExpected("inbandTrack1.kind", "captions"); | |
35 | |
36 consoleWrite("<br><i>** Enable cues and let them load<" + "/i>")
; | |
37 run("video.webkitClosedCaptionsVisible = true"); | |
38 run("video.play()"); | |
39 setTimeout(function() { video.pause(); video.currentTime = 0.3;
}, 1000); | |
40 } | |
41 | |
42 function setup() | |
43 { | |
44 findMediaElement(); | |
45 video.src = '../content/counting-captioned.mov'; | |
46 waitForEvent('seeked', seeked); | |
47 waitForEvent('canplaythrough', canplaythrough); | |
48 } | |
49 | |
50 </script> | |
51 </head> | |
52 <body onload="setup()"> | |
53 <video controls></video> | |
54 <p>Test that in-band tracks work with .webkitClosedCaptionsVisible.</p> | |
55 </body> | |
56 </html> | |
OLD | NEW |