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 video::-webkit-media-text-track-display { |
| 16 background-color: purple; |
| 17 } |
| 18 </style> |
| 19 <script> |
| 20 |
| 21 function initSettings() { |
| 22 if (window.internals) { |
| 23 internals.settings.setTextTrackTextColor("cyan"); |
| 24 internals.settings.setTextTrackBackgroundColor("green"); |
| 25 internals.settings.setTextTrackWindowColor("blue"); |
| 26 internals.settings.setTextTrackTextShadow("2px 2px #ff0000") |
| 27 internals.settings.setTextTrackTextSize("14px"); |
| 28 internals.settings.setTextTrackFontFamily("fantasy"); |
| 29 internals.settings.setTextTrackFontStyle("italic"); |
| 30 internals.settings.setTextTrackFontVariant("small-caps"); |
| 31 } |
| 32 } |
| 33 |
| 34 function checkExpected() { |
| 35 cue = textTrackDisplayElement(video, 'cue'); |
| 36 display = textTrackDisplayElement(video, 'display'); |
| 37 testExpected("getComputedStyle(cue).color", "rgb(0, 255, 255)"); |
| 38 testExpected("getComputedStyle(cue).backgroundColor", "rgb(0, 128, 0)"); |
| 39 testExpected("getComputedStyle(display).backgroundColor", "rgb(0, 0, 255
)"); |
| 40 testExpected("getComputedStyle(cue).textShadow", "rgb(255, 0, 0) 2px 2px
0px"); |
| 41 testExpected("getComputedStyle(cue).fontSize", "14px"); |
| 42 testExpected("getComputedStyle(cue).fontFamily", "fantasy"); |
| 43 testExpected("getComputedStyle(cue).fontStyle", "italic"); |
| 44 testExpected("getComputedStyle(cue).fontVariant", "small-caps"); |
| 45 endTest(); |
| 46 } |
| 47 |
| 48 window.onload = function() { |
| 49 initSettings(); |
| 50 consoleWrite("Test that WebVTT objects are being styled correctly based
on user settings."); |
| 51 findMediaElement(); |
| 52 video.src = findMediaFile('video', '../content/test'); |
| 53 waitForEvent('canplaythrough', checkExpected); |
| 54 } |
| 55 |
| 56 </script> |
| 57 <video> |
| 58 <track src="captions-webvtt/styling.vtt" kind="captions" default> |
| 59 </video> |
OLD | NEW |