Skip to content

Commit 307e3d8

Browse files
authored
fix(HLS): Fix support for SUPPLEMENTAL-CODECS on EXT-X-I-FRAME-STREAM-INF (#7992)
1 parent 213b2b7 commit 307e3d8

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

lib/hls/hls_parser.js

+25
Original file line numberDiff line numberDiff line change
@@ -988,6 +988,31 @@ shaka.hls.HlsParser = class {
988988
new shaka.hls.Tag(tag.id, tag.name, newAttributes, null));
989989
}
990990
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);
9911016
}
9921017

9931018
this.parseCodecs_(variantTags);

0 commit comments

Comments
 (0)