File tree 1 file changed +25
-0
lines changed
1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -988,6 +988,31 @@ shaka.hls.HlsParser = class {
988
988
new shaka . hls . Tag ( tag . id , tag . name , newAttributes , null ) ) ;
989
989
}
990
990
variantTags . push ( ...newVariantTags ) ;
991
+
992
+ // Duplicate iFrame tags with supplementalCodecs
993
+ const newIFrameTags = [ ] ;
994
+ for ( const tag of iFrameTags ) {
995
+ const supplementalCodecsString =
996
+ tag . getAttributeValue ( 'SUPPLEMENTAL-CODECS' ) ;
997
+ if ( ! supplementalCodecsString ) {
998
+ continue ;
999
+ }
1000
+ const supplementalCodecs = supplementalCodecsString . split ( / \s * , \s * / )
1001
+ . map ( ( codec ) => {
1002
+ return codec . split ( '/' ) [ 0 ] ;
1003
+ } ) ;
1004
+ const newAttributes = tag . attributes . map ( ( attr ) => {
1005
+ const name = attr . name ;
1006
+ let value = attr . value ;
1007
+ if ( name == 'CODECS' ) {
1008
+ value = supplementalCodecs . join ( ',' ) ;
1009
+ }
1010
+ return new shaka . hls . Attribute ( name , value ) ;
1011
+ } ) ;
1012
+ newIFrameTags . push (
1013
+ new shaka . hls . Tag ( tag . id , tag . name , newAttributes , null ) ) ;
1014
+ }
1015
+ iFrameTags . push ( ...newIFrameTags ) ;
991
1016
}
992
1017
993
1018
this . parseCodecs_ ( variantTags ) ;
You can’t perform that action at this time.
0 commit comments