Skip to content

Commit

Permalink
feat(emulated-tracks): add class to force cues to be center aligned (#…
Browse files Browse the repository at this point in the history
…8625)

videojs/http-streaming#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).
  • Loading branch information
gkatsev committed Apr 12, 2024
1 parent 3f32de3 commit d715e0f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/css/components/_text-track.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit d715e0f

Please sign in to comment.