Skip to content

Commit

Permalink
fix(HLS): Fix accessibilityPurpose detection (#5840)
Browse files Browse the repository at this point in the history
Closes #5810
  • Loading branch information
avelad authored Oct 31, 2023
1 parent 2e77668 commit ceaa9fa
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/hls/hls_parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -2361,13 +2361,19 @@ shaka.hls.HlsParser = class {
}

let kind = undefined;
let accessibilityPurpose = null;
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;
}
} else {
if (roles.includes('public.accessibility.describes-video')) {
accessibilityPurpose =
shaka.media.ManifestParser.AccessibilityPurpose.VISUALLY_IMPAIRED;
}
}

// If there are no roles, and we have defaulted to the subtitle "kind" for
Expand Down Expand Up @@ -2412,7 +2418,7 @@ shaka.hls.HlsParser = class {
hdr: undefined,
videoLayout: undefined,
tilesLayout: undefined,
accessibilityPurpose: null,
accessibilityPurpose: accessibilityPurpose,
external: false,
};
}
Expand Down

0 comments on commit ceaa9fa

Please sign in to comment.