Skip to content

Commit

Permalink
fix(UI): Fix missing tracks in resolution selector (#7352)
Browse files Browse the repository at this point in the history
  • Loading branch information
avelad authored and joeyparrish committed Sep 26, 2024
1 parent f4ef439 commit 400cc38
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ui/resolution_selection.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ goog.require('shaka.ui.SettingsMenu');
goog.require('shaka.ui.Utils');
goog.require('shaka.util.Dom');
goog.require('shaka.util.FakeEvent');
goog.require('shaka.util.Functional');
goog.requireType('shaka.ui.Controls');


Expand Down Expand Up @@ -91,6 +92,7 @@ shaka.ui.ResolutionSelection = class extends shaka.ui.SettingsMenu {
return false;
}
if (this.controls.getConfig().showAudioChannelCountVariants &&
track.channelsCount && selectedTrack.channelsCount &&
track.channelsCount != selectedTrack.channelsCount) {
return false;
}
Expand All @@ -117,7 +119,8 @@ shaka.ui.ResolutionSelection = class extends shaka.ui.SettingsMenu {
return tracks.findIndex((t) => t.bandwidth == track.bandwidth) == idx;
});
} else {
const audiosIds = [...new Set(tracks.map((t) => t.audioId))];
const audiosIds = [...new Set(tracks.map((t) => t.audioId))]
.filter(shaka.util.Functional.isNotNull);
if (audiosIds.length > 1) {
tracks = tracks.filter((track, idx) => {
// Keep the first one with the same height and framerate or bandwidth.
Expand Down

0 comments on commit 400cc38

Please sign in to comment.