diff --git a/lib/hls/hls_parser.js b/lib/hls/hls_parser.js index cf5009821c2..0aa224f6979 100644 --- a/lib/hls/hls_parser.js +++ b/lib/hls/hls_parser.js @@ -1207,7 +1207,7 @@ shaka.hls.HlsParser = class { // "AUTOSELECT=YES". A value of "AUTOSELECT=NO" would imply that it may // only be selected explicitly by the user, and we don't have a way to // represent that in our model. - const defaultAttrValue = tag.getAttribute('DEFAULT'); + const defaultAttrValue = tag.getAttributeValue('DEFAULT'); const primary = defaultAttrValue == 'YES'; const channelsCount = type == 'audio' ? this.getChannelsCount_(tag) : null; diff --git a/test/hls/hls_parser_unit.js b/test/hls/hls_parser_unit.js index 67c000c123e..25c38b1a1a3 100644 --- a/test/hls/hls_parser_unit.js +++ b/test/hls/hls_parser_unit.js @@ -785,7 +785,7 @@ describe('HlsParser', () => { 'RESOLUTION=960x540,FRAME-RATE=120,AUDIO="aud2"\n', 'video2\n', '#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="aud1",LANGUAGE="eng",', - 'URI="audio"\n', + 'DEFAULT=YES,URI="audio"\n', '#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="aud2",LANGUAGE="fr",', 'URI="audio2"\n', ].join(''); @@ -803,6 +803,7 @@ describe('HlsParser', () => { manifest.anyTimeline(); manifest.addPartialVariant((variant) => { variant.bandwidth = 200; + variant.primary = true; variant.addPartialStream(ContentType.VIDEO, (stream) => { stream.size(960, 540); }); @@ -812,6 +813,7 @@ describe('HlsParser', () => { }); manifest.addPartialVariant((variant) => { variant.bandwidth = 300; + variant.primary = false; variant.addPartialStream(ContentType.VIDEO, (stream) => { stream.size(960, 540); });