diff --git a/lib/hls/hls_parser.js b/lib/hls/hls_parser.js index 63a62a8a3b..059a5fead2 100644 --- a/lib/hls/hls_parser.js +++ b/lib/hls/hls_parser.js @@ -2360,8 +2360,15 @@ shaka.hls.HlsParser = class { } } - const kind = (type == shaka.util.ManifestParserUtils.ContentType.TEXT) ? - shaka.util.ManifestParserUtils.TextStreamKind.SUBTITLE : undefined; + let kind = undefined; + if (type == shaka.util.ManifestParserUtils.ContentType.TEXT) { + if (roles.includes('public.accessibility.transcribes-spoken-dialog') && + roles.includes('public.accessibility.describes-music-and-sound')) { + kind = shaka.util.ManifestParserUtils.TextStreamKind.CLOSED_CAPTION; + } else { + kind = shaka.util.ManifestParserUtils.TextStreamKind.SUBTITLE; + } + } // If there are no roles, and we have defaulted to the subtitle "kind" for // this track, add the implied subtitle role.