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 | 5 |
6 <script src=../media-file.js></script> | 6 <script src=../media-file.js></script> |
7 <script src=../video-test.js></script> | 7 <script src=../video-test.js></script> |
8 | 8 |
9 <script> | 9 <script> |
10 function startTest() | 10 function startTest() |
11 { | 11 { |
12 findMediaElement(); | 12 findMediaElement(); |
13 | 13 |
14 consoleWrite("** Add a text track through JS to the video element **
"); | 14 consoleWrite("** Add a text track through JS to the video element **
"); |
15 var t = video.addTextTrack('captions', 'English', 'en'); | 15 var t = video.addTextTrack('captions', 'English', 'en'); |
16 | 16 |
17 consoleWrite("** Add cue to the text track **"); | 17 consoleWrite("** Add cue to the text track **"); |
18 t.addCue(new TextTrackCue(0.0, 10.0, 'wow wow')); | 18 t.addCue(new VTTCue(0.0, 10.0, 'wow wow')); |
19 | 19 |
20 consoleWrite("** Set the track mode to showing **"); | 20 consoleWrite("** Set the track mode to showing **"); |
21 t.mode = "showing"; | 21 t.mode = "showing"; |
22 | 22 |
23 consoleWrite(""); | 23 consoleWrite(""); |
24 consoleWrite("No crash. PASS."); | 24 consoleWrite("No crash. PASS."); |
25 consoleWrite(""); | 25 consoleWrite(""); |
26 | 26 |
27 endTest(); | 27 endTest(); |
28 } | 28 } |
29 </script> | 29 </script> |
30 </head> | 30 </head> |
31 | 31 |
32 <body onload="startTest()"> | 32 <body onload="startTest()"> |
33 <p>Tests that adding a track and changing its mode through JS doesn't cr
ash the browser.</p> | 33 <p>Tests that adding a track and changing its mode through JS doesn't cr
ash the browser.</p> |
34 <video controls> | 34 <video controls> |
35 <!-- If the src is specified through JS after the body load, the tes
t doesn't crash anymore. --> | 35 <!-- If the src is specified through JS after the body load, the tes
t doesn't crash anymore. --> |
36 <source src="../content/test.mp4" type="video/mp4"> | 36 <source src="../content/test.mp4" type="video/mp4"> |
37 <source src="../content/test.ogv" type="video/ogg"> | 37 <source src="../content/test.ogv" type="video/ogg"> |
38 </video> | 38 </video> |
39 </body> | 39 </body> |
40 </html> | 40 </html> |
OLD | NEW |