Skip to content

Commit

Permalink
fix(ttml): Center subtitles by default (#4023)
Browse files Browse the repository at this point in the history
Closes: #4015
  • Loading branch information
Álvaro Velad Galván authored and joeyparrish committed Mar 22, 2022
1 parent 26864ba commit 483966c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/text/ttml_text_parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -536,8 +536,10 @@ shaka.text.TtmlTextParser = class {

cue.textAlign = Cue.textAlign[align.toUpperCase()];
} else {
// Default value is START: https://bit.ly/32OGmvo
cue.textAlign = Cue.textAlign.START;
// Default value is START in the TTML spec: https://bit.ly/32OGmvo
// But to make the subtitle render consitent with other players and the
// shaka.text.Cue we use CENTER
cue.textAlign = Cue.textAlign.CENTER;
}

const displayAlign = TtmlTextParser.getStyleAttribute_(
Expand Down

0 comments on commit 483966c

Please sign in to comment.