You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm still using Videojs 4.6.4 because - so I'm told - one of the “happy accidents” of Video.js 4.x is that it leaves the <track> element in the DOM and lets you style captions with CSS like any other element. So you can set font-size, color and line-height in videojs.css and use those styles in your .VTT caption files instead of video::cue. On my site I've also set .vjs-text-track-display to display as a table-cell; height: 100%; width: 100%; which allows positioning captions anywhere on the video. So things like this are possible in the VTT file:
03:11.000 --> 03:12.000
<p class="center-middle big fade-out">Text text text
These VTT-with-CSS files render as intended in most browsers and OSs I've tested - e.g. Chrome & Firefox on Windows, Safari on iphones/ipad, Firefox on android. So, it's a great feature for combining your video with some flashy captions styled however you please.
But lately I've discovered that - sometimes - Chrome and Samsung Internet on Android ignore .vjs-text-track-display p and render them as boring native captions centered at the bottom of the screen. It doesn't happen always - in fact most times it displays the styled <track> captions as intended, but maybe 1 out of 5 times it doesn't. How can a bug be so random? What's going on "under the hood/bonnet"? Any ideas?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I'm still using Videojs 4.6.4 because - so I'm told - one of the “happy accidents” of Video.js 4.x is that it leaves the
<track>element in the DOM and lets you style captions with CSS like any other element. So you can setfont-size,colorandline-heightin videojs.css and use those styles in your .VTT caption files instead ofvideo::cue. On my site I've also set.vjs-text-track-displayto display as atable-cell; height: 100%; width: 100%;which allows positioning captions anywhere on the video. So things like this are possible in the VTT file:These VTT-with-CSS files render as intended in most browsers and OSs I've tested - e.g. Chrome & Firefox on Windows, Safari on iphones/ipad, Firefox on android. So, it's a great feature for combining your video with some flashy captions styled however you please.
But lately I've discovered that - sometimes - Chrome and Samsung Internet on Android ignore
.vjs-text-track-display pand render them as boring native captions centered at the bottom of the screen. It doesn't happen always - in fact most times it displays the styled<track>captions as intended, but maybe 1 out of 5 times it doesn't. How can a bug be so random? What's going on "under the hood/bonnet"? Any ideas?Beta Was this translation helpful? Give feedback.
All reactions