OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
5 <title>Test closed caption button toggling.</title> | 5 <title>Test closed caption button toggling.</title> |
6 <script src=media-file.js></script> | 6 <script src=media-file.js></script> |
7 <script src=media-controls.js></script> | 7 <script src=media-controls.js></script> |
8 <script src=video-test.js></script> | 8 <script src=video-test.js></script> |
9 <script> | 9 <script> |
10 var displayElement; | 10 var displayElement; |
11 var track; | 11 var track; |
12 var text = ["First", "Second", "Third"]; | 12 var text = ["First", "Second", "Third"]; |
13 | 13 |
14 function addTextTrack() | 14 function addTextTrack() |
15 { | 15 { |
16 track = video.addTextTrack('captions'); | 16 track = video.addTextTrack('captions'); |
17 | 17 |
18 for(var i = 0; i < 3; i++) { | 18 for(var i = 0; i < 3; i++) { |
19 var cue = new TextTrackCue(0, 120, text[i]); | 19 var cue = new VTTCue(0, 120, text[i]); |
20 track.addCue(cue); | 20 track.addCue(cue); |
21 } | 21 } |
22 } | 22 } |
23 | 23 |
24 function checkCaptionsDisplay() | 24 function checkCaptionsDisplay() |
25 { | 25 { |
26 for (var i = 0; i < 3; i++) { | 26 for (var i = 0; i < 3; i++) { |
27 try { | 27 try { |
28 displayElement = textTrackDisplayElement(video, 'display', i
); | 28 displayElement = textTrackDisplayElement(video, 'display', i
); |
29 testExpected("displayElement.innerText", text[i]); | 29 testExpected("displayElement.innerText", text[i]); |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 | 77 |
78 video.src = findMediaFile('video', 'content/counting'); | 78 video.src = findMediaFile('video', 'content/counting'); |
79 } | 79 } |
80 </script> | 80 </script> |
81 </head> | 81 </head> |
82 <body onload="loaded()"> | 82 <body onload="loaded()"> |
83 <p>Tests that multiple toggles of the closed captions button still display c
aptions</p> | 83 <p>Tests that multiple toggles of the closed captions button still display c
aptions</p> |
84 <video controls></video> | 84 <video controls></video> |
85 </body> | 85 </body> |
86 </html> | 86 </html> |
OLD | NEW |