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

Webvtt subtitles and embedded colouring. #6581

Closed
luiscurini opened this issue Oct 25, 2019 · 6 comments · Fixed by #4178
Closed

Webvtt subtitles and embedded colouring. #6581

luiscurini opened this issue Oct 25, 2019 · 6 comments · Fixed by #4178
Assignees

Comments

@luiscurini
Copy link

Hi , I'm using exoplayer 2.10.6

Is there a way to enable embedded subtitle colouring in Webvtt subtitles? For example:

00:10:21.920 --> 00:10:23.960 line:83%
<c.white.bg_black>Test subtitle white foreground, black background</c>

00:10:56.840 --> 00:11:00.080 line:75%
<c.lime.bg_black>Test subtitle green, black background</c>

Bold, italics and underline Tags works but dynamic colouring doesn't.

@icbaker
Copy link
Collaborator

icbaker commented Oct 25, 2019

Thanks for the report, I agree color (and font) styling doesn't seem to work in WebVTT currently.

Seems these are the relevant bits of the spec:
https://www.w3.org/TR/webvtt1/#default-text-color
https://www.w3.org/TR/webvtt1/#default-text-background

Marking this as an enhancement.

This is also tracked internally under issue 143200233.

@luiscurini
Copy link
Author

luiscurini commented Oct 25, 2019

Thanks!

I got the colouring working by embedding the styles into the webvtt file. So it'd be something like this:

WEBVTT

STYLE
::cue(.cyan) {
  color: cyan;
}

STYLE
::cue(.white) {
  color: white;
}

STYLE
::cue(.bg_black) {
  background-color: black;	
}

00:00:10.240 --> 00:00:13.720 line:83%
<c.white.bg_black>Test subtitle white foreground, black background</c>

00:00:28.400 --> 00:00:33.080 line:83%
<c.cyan.bg_black>Test subtitle blue foreground, black background</c>

But it would be a nice enhancement to support the default styles or give the possibility to provide a CSS file with the styles.

@icbaker
Copy link
Collaborator

icbaker commented Feb 12, 2020

Related: #4178

@danybony

This comment has been minimized.

@icbaker

This comment has been minimized.

@icbaker icbaker linked a pull request Feb 14, 2020 that will close this issue
@icbaker
Copy link
Collaborator

icbaker commented Feb 17, 2020

Should be working in dev-v2.

@icbaker icbaker closed this as completed Feb 17, 2020
@google google locked and limited conversation to collaborators Apr 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants