Skip to content

Commit f2f24d5

Browse files
author
Álvaro Velad Galván
authored
fix(ttml): Center subtitles by default (#4023)
Closes: #4015
1 parent 3a6daa1 commit f2f24d5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/text/ttml_text_parser.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -544,8 +544,10 @@ shaka.text.TtmlTextParser = class {
544544

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

551553
const displayAlign = TtmlTextParser.getStyleAttribute_(

0 commit comments

Comments
 (0)