diff --git a/externs/texttrack.js b/externs/texttrack.js index eb08617ca2..d792eb4b9a 100644 --- a/externs/texttrack.js +++ b/externs/texttrack.js @@ -33,3 +33,15 @@ TextTrackCue.prototype.positionAlign; /** @type {string} */ TextTrackCue.prototype.lineAlign; + + +/** @type {number|null|string} */ +TextTrackCue.prototype.line; + + +/** @type {string} */ +TextTrackCue.prototype.vertical; + + +/** @type {boolean} */ +TextTrackCue.prototype.snapToLines; diff --git a/lib/media/ttml_text_parser.js b/lib/media/ttml_text_parser.js index 2f69d594e5..321ee31a39 100644 --- a/lib/media/ttml_text_parser.js +++ b/lib/media/ttml_text_parser.js @@ -336,6 +336,12 @@ shaka.media.TtmlTextParser.addStyle_ = function( cue.position = Number(results[1]); cue.line = Number(results[2]); } + // A boolean indicating whether the line is an integer + // number of lines (using the line dimensions of the first + // line of the cue), or whether it is a percentage of the + // dimension of the video. The flag is set to true when lines + // are counted, and false otherwise. + cue.snapToLines = false; } }