Skip to content

Commit

Permalink
fix(HLS): Fix kind detection for 'captions' text tracks (#5819)
Browse files Browse the repository at this point in the history
Related to #5810
  • Loading branch information
avelad authored and joeyparrish committed Feb 17, 2024
1 parent 5622cda commit a4fa63b
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lib/hls/hls_parser.js
Expand Up @@ -2091,8 +2091,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.
Expand Down

0 comments on commit a4fa63b

Please sign in to comment.