| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE html> | |
| 2 <html> | |
| 3 <head> | |
| 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
| 5 <title>Test non-default track load according to user language preference.</t
itle> | |
| 6 <script src=media-file.js></script> | |
| 7 <script src=media-controls.js></script> | |
| 8 <script src=video-test.js></script> | |
| 9 <script> | |
| 10 var track; | |
| 11 | |
| 12 function startTest() | |
| 13 { | |
| 14 if (!window.eventSender) { | |
| 15 consoleWrite("No eventSender found."); | |
| 16 failTest(); | |
| 17 } | |
| 18 | |
| 19 findMediaElement(); | |
| 20 testClosedCaptionsButtonVisibility(true); | |
| 21 | |
| 22 consoleWrite(""); | |
| 23 consoleWrite("** The captions track should be listed in textTracks,
but disabled. **"); | |
| 24 testExpected("video.textTracks.length", 2); | |
| 25 testExpected("video.textTracks[0].mode", "disabled"); | |
| 26 testExpected("video.textTracks[1].mode", "disabled"); | |
| 27 | |
| 28 consoleWrite(""); | |
| 29 consoleWrite("** Set the user language preference so that the track
will be chosen when the CC button is clicked. **"); | |
| 30 run("internals.setUserPreferredLanguages(['ar'])"); | |
| 31 clickCCButton(); | |
| 32 } | |
| 33 | |
| 34 function loaded() | |
| 35 { | |
| 36 findMediaElement(); | |
| 37 waitForEvent('canplaythrough', startTest); | |
| 38 | |
| 39 video.src = findMediaFile('video', 'content/counting'); | |
| 40 } | |
| 41 </script> | |
| 42 </head> | |
| 43 <body onload="loaded()"> | |
| 44 <p>Tests that appropriate language track is loaded, according to user prefer
ences.</p> | |
| 45 <video controls> | |
| 46 <track src="track/captions-webvtt/captions-fast.vtt" kind="captions"> | |
| 47 <track src="track/captions-webvtt/captions-fast.vtt" kind="captions" src
lang="ar" onload="endTest()"> | |
| 48 </video> | |
| 49 </body> | |
| 50 </html> | |
| OLD | NEW |