Skip to content

Commit

Permalink
fix(HLS): Fix kind detection for 'captions' text tracks (shaka-projec…
Browse files Browse the repository at this point in the history
  • Loading branch information
avelad authored and Rodolphe Breton committed Nov 30, 2023
1 parent 238ccb2 commit b5d02f5
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lib/hls/hls_parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit b5d02f5

Please sign in to comment.