Skip to content

Commit

Permalink
Match characteristics in tracks with undefined value
Browse files Browse the repository at this point in the history
#6962

(cherry picked from commit 7a0ded1)
  • Loading branch information
robwalch committed Jan 21, 2025
1 parent 3ab7dba commit b747d3a
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions src/utils/rendition-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -368,14 +368,7 @@ export function matchesOption(
track: MediaPlaylist,
) => boolean,
): boolean {
const {
groupId,
name,
lang,
assocLang,
characteristics,
default: isDefault,
} = option;
const { groupId, name, lang, assocLang, default: isDefault } = option;
const forced = (option as SubtitleSelectionOption).forced;
return (
(groupId === undefined || track.groupId === groupId) &&
Expand All @@ -384,8 +377,11 @@ export function matchesOption(
(lang === undefined || track.assocLang === assocLang) &&
(isDefault === undefined || track.default === isDefault) &&
(forced === undefined || track.forced === forced) &&
(characteristics === undefined ||
characteristicsMatch(characteristics, track.characteristics)) &&
(!('characteristics' in option) ||
characteristicsMatch(
option.characteristics || '',
track.characteristics,
)) &&
(matchPredicate === undefined || matchPredicate(option, track))
);
}
Expand Down

0 comments on commit b747d3a

Please sign in to comment.