Skip to content

Commit

Permalink
feat(UI): Use the same logic to group variants into audio and quality…
Browse files Browse the repository at this point in the history
… selectors (#6069)

Related to #6039
  • Loading branch information
avelad committed Jan 10, 2024
1 parent 3ce4399 commit eabfc47
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions ui/resolution_selection.js
Expand Up @@ -80,10 +80,16 @@ shaka.ui.ResolutionSelection = class extends shaka.ui.SettingsMenu {
// available resolutions.
const selectedTrack = tracks.find((track) => track.active);
if (selectedTrack) {
// Filter by current audio language and channel count.
tracks = tracks.filter(
(track) => track.language == selectedTrack.language &&
track.channelsCount == selectedTrack.channelsCount);
if (this.controls.getConfig().showAudioChannelCountVariants) {
// Filter by current audio language and channel count.
tracks = tracks.filter(
(track) => track.language == selectedTrack.language &&
track.channelsCount == selectedTrack.channelsCount);
} else {
// Filter by current audio language.
tracks = tracks.filter(
(track) => track.language == selectedTrack.language);
}
}

// Remove duplicate entries with the same resolution or quality depending
Expand Down

0 comments on commit eabfc47

Please sign in to comment.