@@ -306,9 +306,16 @@ shaka.text.TtmlTextParser = class {
306306 const regionId = regionElement . getAttribute ( 'xml:id' ) ;
307307 cue . region = cueRegions . filter ( ( region ) => region . id == regionId ) [ 0 ] ;
308308 }
309- const imageElement = shaka . text . TtmlTextParser . getElementsFromCollection_ (
310- cueElement , 'backgroundImage' , metadataElements , '#' ,
311- shaka . text . TtmlTextParser . smpteNs_ ) [ 0 ] ;
309+
310+ let imageElement = null ;
311+ for ( const nameSpace of shaka . text . TtmlTextParser . smpteNsList_ ) {
312+ imageElement = shaka . text . TtmlTextParser . getElementsFromCollection_ (
313+ cueElement , 'backgroundImage' , metadataElements , '#' ,
314+ nameSpace ) [ 0 ] ;
315+ if ( imageElement ) {
316+ break ;
317+ }
318+ }
312319
313320 const isLeaf = nestedCues . length == 0 ;
314321
@@ -1243,12 +1250,14 @@ shaka.text.TtmlTextParser.styleNs_ = 'http://www.w3.org/ns/ttml#styling';
12431250shaka . text . TtmlTextParser . styleEbuttsNs_ = 'urn:ebu:tt:style' ;
12441251
12451252/**
1246- * The namespace URL for SMPTE fields.
1247- * @const {string}
1253+ * The supported namespace URLs for SMPTE fields.
1254+ * @const {!Array.< string> }
12481255 * @private
12491256 */
1250- shaka . text . TtmlTextParser . smpteNs_ =
1251- 'http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt' ;
1257+ shaka . text . TtmlTextParser . smpteNsList_ = [
1258+ 'http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt' ,
1259+ 'http://www.smpte-ra.org/schemas/2052-1/2013/smpte-tt' ,
1260+ ] ;
12521261
12531262shaka . text . TextEngine . registerParser (
12541263 'application/ttml+xml' , ( ) => new shaka . text . TtmlTextParser ( ) ) ;
0 commit comments