Skip to content

Commit

Permalink
cleanup(text): Remove hard-coded tts:extent namespace in TTML parser
Browse files Browse the repository at this point in the history
Closes #2860

Backported to v2.5.x

Change-Id: I89bf96fa6536032ae20e85ba062cfc788dafd2c9
  • Loading branch information
Álvaro Velad Galván authored and joeyparrish committed Oct 1, 2020
1 parent 2dd59c5 commit 3231561
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/text/ttml_text_parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ shaka.text.TtmlTextParser.prototype.parseMedia = function(data, time) {
const TtmlTextParser = shaka.text.TtmlTextParser;
const XmlUtils = shaka.util.XmlUtils;
const ttpNs = TtmlTextParser.parameterNs_;
const ttsNs = TtmlTextParser.styleNs_;
let str = shaka.util.StringUtils.fromUTF8(data);
let ret = [];
let parser = new DOMParser();
Expand Down Expand Up @@ -122,7 +123,7 @@ shaka.text.TtmlTextParser.prototype.parseMedia = function(data, time) {
XmlUtils.getAttributeNS(tt, ttpNs, 'frameRateMultiplier');
tickRate = XmlUtils.getAttributeNS(tt, ttpNs, 'tickRate');
spaceStyle = tt.getAttribute('xml:space') || 'default';
extent = tt.getAttribute('tts:extent');
extent = XmlUtils.getAttributeNS(tt, ttsNs, 'extent');
}

if (spaceStyle != 'default' && spaceStyle != 'preserve') {
Expand Down Expand Up @@ -519,7 +520,7 @@ shaka.text.TtmlTextParser.parseCue_ = function(
* @param {!Element} regionElement
* @param {!Array.<!Element>} styles Defined in the top of tt element and
* used principally for images.
* @param {string} globalExtent
* @param {?string} globalExtent
* @return {shaka.text.CueRegion}
* @private
*/
Expand Down

0 comments on commit 3231561

Please sign in to comment.