-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
fix(WebVTT): Fix voices with styles and support to multiple styles #4922
Conversation
Incremental code coverage: 68.63% |
lib/text/vtt_text_parser.js
Outdated
propertyLines = payload[1].split(';'); | ||
for (const styleBlock of styleBlocks) { | ||
let styleSelector = 'global'; | ||
// Look for what is within parentisesis. For example: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(old) typo: parentheses
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed!
lib/text/vtt_text_parser.js
Outdated
cue.fontSize = value; | ||
break; | ||
case 'font-weight': | ||
if (parseInt(value, 10) >= 700) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about non-integer values?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added support to bold
cue.fontStyle = shaka.text.Cue.fontStyle.ITALIC; | ||
break; | ||
case 'oblique': | ||
cue.backgroundColor = value; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test case uses "background" instead of "background-color". Could you support that, too, even just making 'background' an alias to 'background-color' for now?
WEBVTT
STYLE
*|*::cue(b) {
background: blue
}
|*::cue(i) {
color: blue;
}
::cue(i) {
background: white;
}
*::cue(b) {
color: white;
}
::cue {
font-size: 11px;
}
00:00:00.000 --> 00:00:05.000
This <i>is</i> a <b>test</b> subtitle
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added!
No description provided.