Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(UI): Fix resolution selection on src= #5367

Merged
merged 4 commits into from
Jun 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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