Skip to content

Commit

Permalink
fix(hls): Support multiple CHARACTERISTICS values in HLS (shaka-proje…
Browse files Browse the repository at this point in the history
  • Loading branch information
Álvaro Velad Galván authored Oct 13, 2020
1 parent 648e12e commit f7626ff
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion lib/hls/hls_parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -1322,7 +1322,9 @@ shaka.hls.HlsParser = class {

const roles = [];
if (characteristics) {
roles.push(characteristics);
for (const characteristic of characteristics.split(',')) {
roles.push(characteristic);
}
}

/** @type {shaka.extern.Stream} */
Expand Down
8 changes: 6 additions & 2 deletions test/hls/hls_parser_unit.js
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,8 @@ describe('HlsParser', () => {
'#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="aud1",LANGUAGE="en",',
'URI="audio"\n',
'#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="aud1",LANGUAGE="en",',
'CHARACTERISTICS="public.accessibility.describes-video",URI="audio2"\n',
'CHARACTERISTICS="public.accessibility.describes-video,',
'public.accessibility.describes-music-and-sound",URI="audio2"\n',
].join('');

const media = [
Expand All @@ -825,7 +826,10 @@ describe('HlsParser', () => {
variant.addPartialStream(ContentType.VIDEO);
variant.addPartialStream(ContentType.AUDIO, (stream) => {
stream.language = 'en';
stream.roles = ['public.accessibility.describes-video'];
stream.roles = [
'public.accessibility.describes-video',
'public.accessibility.describes-music-and-sound',
];
});
});
});
Expand Down

0 comments on commit f7626ff

Please sign in to comment.