Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Caption style customisation #6284

Open
featheast opened this issue Mar 14, 2024 · 1 comment
Open

Caption style customisation #6284

featheast opened this issue Mar 14, 2024 · 1 comment
Labels

Comments

@featheast
Copy link

featheast commented Mar 14, 2024

What do you want to do with Hls.js?

We are/were using VideoJS 7, and have a very consistent style of closed caption (608/708). There are also ways to configure the look and feel (css styles) of the captions for different use cases.

While with hls.js player, I am yet to find a way to customise the look and feel of the closed captions, like font size, color, text alignment, line height between each text lines?

What have you tried so far?

Not much I have tried other than comparing the caption rendering from both standard video.js and hls.js player.

Below are 2 screenshots I took for comparison purposes. The top one is from VideoJS, where the captions are centred on screen, with a settings panel available to update the style accordingly.
The next one is from Hls.js, where the texts are all left aligned, with a background color all the way to the rightmost, even though the text only filled less than half of the screen.

Screenshot 2024-03-14 at 4 25 17 pm Screenshot 2024-03-14 at 4 25 27 pm
@featheast featheast added Needs Triage If there is a suspected stream issue, apply this label to triage if it is something we should fix. Question labels Mar 14, 2024
@robwalch
Copy link
Collaborator

CSS can be used to style caption cues by targeting the shadow-dom elements in the HTMLVideoElement captions TextTrack.

HLS.js focuses on HLS support and leaves styling and UI to the application using HLS.js. You might consider looking at player projects that use HLS.js such as media-chrome.

@itsjamie itsjamie removed the Needs Triage If there is a suspected stream issue, apply this label to triage if it is something we should fix. label Mar 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants