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 committed Mar 10, 2022
1 parent 3a6daa1 commit f2f24d5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/text/ttml_text_parser.js
Expand Up @@ -544,8 +544,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 f2f24d5

Please sign in to comment.