OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <script src=../media-file.js></script> |
| 3 <script src=../video-test.js></script> |
| 4 <script src=../media-controls.js></script> |
| 5 <style> |
| 6 video::cue { |
| 7 color: lime; |
| 8 background-color: yellow; |
| 9 text-shadow: 4px 4px #ff0000; |
| 10 font-size: 10px; |
| 11 font-family: serif; |
| 12 font-style: normal; |
| 13 font-variant: normal; |
| 14 } |
| 15 </style> |
| 16 <script> |
| 17 |
| 18 function initSettings() { |
| 19 if (window.internals) { |
| 20 internals.settings.setTextTrackTextColor("cyan"); |
| 21 internals.settings.setTextTrackBackgroundColor("green"); |
| 22 internals.settings.setTextTrackTextShadow("2px 2px #ff0000") |
| 23 internals.settings.setTextTrackTextSize("14px"); |
| 24 internals.settings.setTextTrackFontFamily("fantasy"); |
| 25 internals.settings.setTextTrackFontStyle("italic"); |
| 26 internals.settings.setTextTrackFontVariant("small-caps"); |
| 27 } |
| 28 } |
| 29 |
| 30 function checkExpected() { |
| 31 cue = textTrackDisplayElement(video, 'cue'); |
| 32 testExpected("getComputedStyle(cue).color", "rgb(0, 255, 255)"); |
| 33 testExpected("getComputedStyle(cue).backgroundColor", "rgb(0, 128, 0)"); |
| 34 testExpected("getComputedStyle(cue).textShadow", "rgb(255, 0, 0) 2px 2px
0px"); |
| 35 testExpected("getComputedStyle(cue).fontSize", "14px"); |
| 36 testExpected("getComputedStyle(cue).fontFamily", "fantasy"); |
| 37 testExpected("getComputedStyle(cue).fontStyle", "italic"); |
| 38 testExpected("getComputedStyle(cue).fontVariant", "small-caps"); |
| 39 endTest(); |
| 40 } |
| 41 |
| 42 window.onload = function() { |
| 43 initSettings(); |
| 44 consoleWrite("Test that WebVTT objects are being styled correctly based
on user settings."); |
| 45 findMediaElement(); |
| 46 video.src = findMediaFile('video', '../content/test'); |
| 47 waitForEvent('canplaythrough', checkExpected); |
| 48 } |
| 49 |
| 50 </script> |
| 51 <video> |
| 52 <track src="captions-webvtt/styling.vtt" kind="captions" default> |
| 53 </video> |
OLD | NEW |