From d715e0fe03c0cb48e8c38be70c90e4bead6019f6 Mon Sep 17 00:00:00 2001 From: Gary Katsevman Date: Fri, 12 Apr 2024 14:45:50 -0400 Subject: [PATCH] feat(emulated-tracks): add class to force cues to be center aligned (#8625) https://github.com/videojs/http-streaming/pull/1408 updated 608 captions to default to be left aligned. This may be unwanted by some folks and we should provide an easier way to force them to be centered. This PR adds a player level class that will override the text alignment to be `center`. It also overrides the `width` to `80%` because otherwise the cue box isn't set up correctly to be 10% from the right of the display area (a side effect of hardcoding a width value and using inset in the generation of the cues). --- src/css/components/_text-track.scss | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/css/components/_text-track.scss b/src/css/components/_text-track.scss index 9f1ab7a342..2ebee49b95 100644 --- a/src/css/components/_text-track.scss +++ b/src/css/components/_text-track.scss @@ -40,3 +40,9 @@ video::-webkit-media-text-track-display { .video-js.vjs-user-inactive.vjs-playing video::-webkit-media-text-track-display { @include transform(translateY(-1.5em)); } + +// force cues to be center aligned +.video-js.vjs-force-center-align-cues .vjs-text-track-cue { + text-align: center !important; + width: 80% !important; +}