OLD | NEW |
---|---|
(Empty) | |
1 <!DOCTYPE html> | |
2 <script src="../media-file.js"></script> | |
3 <script src="../video-test.js"></script> | |
philipj_slow
2016/03/01 09:08:27
In the new tests that use video-test.js, can you a
srivats
2016/03/30 00:46:42
Of course. Added
| |
4 <script src="../media-controls.js"></script> | |
5 <script> | |
6 | |
7 var trackCueText = "Bonjour"; | |
8 | |
9 function selectTrackAdded() | |
10 { | |
11 findMediaElement(); | |
12 testClosedCaptionsButtonVisibility(true); | |
13 consoleWrite(""); | |
14 testExpected("video.textTracks.length", 2); | |
15 testExpected("video.textTracks[0].mode", "showing"); | |
16 testExpected("video.textTracks[1].mode", "hidden"); | |
17 | |
18 consoleWrite(""); | |
19 consoleWrite("Verify the default track is being displayed"); | |
20 testExpected("textTrackDisplayElement(video, 'display').innerText", "Lor em"); | |
21 | |
22 consoleWrite(""); | |
23 consoleWrite("Select the newly added track"); | |
24 selectTextTrack(video, 1); | |
25 testExpected("video.textTracks[1].mode", "showing"); | |
26 testExpected("video.textTracks[0].mode", "disabled"); | |
27 testExpected("textTrackDisplayElement(video, 'display').innerText", trac kCueText); | |
28 endTest(); | |
29 } | |
30 | |
31 function addTextTrack() | |
32 { | |
33 track = video.addTextTrack("captions", "French", "fr"); | |
34 track.addCue(new VTTCue(0.0, 1.0, trackCueText)); | |
35 selectTrackAdded(); | |
36 } | |
37 | |
38 window.onload = function() | |
39 { | |
40 consoleWrite("Test that we can add a track dynamically and it is display ed on the track selection menu"); | |
41 findMediaElement(); | |
42 video.src = findMediaFile("video", "../content/test"); | |
43 waitForEvent("canplaythrough", addTextTrack); | |
44 } | |
45 | |
46 </script> | |
47 <video controls> | |
48 <track src="captions-webvtt/captions.vtt" kind="captions" label="English" sr clang="en" default> | |
49 </video> | |
OLD | NEW |