Skip to content

Commit

Permalink
fix(UI): Fix resolution selection on src= (#5367)
Browse files Browse the repository at this point in the history
With this change, when we are in src= mode we only leave the automatic
mode in the resolution selector, since we will not be able to change the
resolution.

Fixes #5330
  • Loading branch information
avelad authored and joeyparrish committed Jul 20, 2023
1 parent 3373a41 commit b570e92
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ui/resolution_selection.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
goog.provide('shaka.ui.ResolutionSelection');

goog.require('goog.asserts');
goog.require('shaka.Player');
goog.require('shaka.ui.Controls');
goog.require('shaka.ui.Enums');
goog.require('shaka.ui.Locales');
Expand Down Expand Up @@ -67,7 +68,12 @@ shaka.ui.ResolutionSelection = class extends shaka.ui.SettingsMenu {
/** @private */
updateResolutionSelection_() {
/** @type {!Array.<shaka.extern.Track>} */
let tracks = this.player.getVariantTracks();
let tracks = [];
// When played with src=, the variant tracks available from
// player.getVariantTracks() represent languages, not resolutions.
if (this.player.getLoadMode() != shaka.Player.LoadMode.SRC_EQUALS) {
tracks = this.player.getVariantTracks();
}

// If there is a selected variant track, then we filter out any tracks in
// a different language. Then we use those remaining tracks to display the
Expand Down

0 comments on commit b570e92

Please sign in to comment.