Skip to content

Commit

Permalink
support stl justification when converting to webvtt
Browse files Browse the repository at this point in the history
  • Loading branch information
dlecorfec committed Jan 4, 2021
1 parent 9df47df commit aa26d4a
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion subtitles.go
Expand Up @@ -246,7 +246,18 @@ type StyleAttributes struct {

func (sa *StyleAttributes) propagateSSAAttributes() {}

func (sa *StyleAttributes) propagateSTLAttributes() {}
func (sa *StyleAttributes) propagateSTLAttributes() {
if sa.STLJustification != nil {
switch *sa.STLJustification {
case JustificationCentered:
// default to middle anyway?
case JustificationRight:
sa.WebVTTAlign = "right"
case JustificationLeft:
sa.WebVTTAlign = "left"
}
}
}

func (sa *StyleAttributes) propagateTeletextAttributes() {
if sa.TeletextColor != nil {
Expand Down

0 comments on commit aa26d4a

Please sign in to comment.