From 3863c73a15343e7879385c636a47c4a077d84e87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Velad=20Galv=C3=A1n?= Date: Wed, 28 Jun 2023 12:56:08 +0200 Subject: [PATCH] fix(UI): Fix resolution selection on src= (#5367) 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 https://github.com/shaka-project/shaka-player/issues/5330 --- ui/resolution_selection.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ui/resolution_selection.js b/ui/resolution_selection.js index 7563022791..f89e3528ba 100644 --- a/ui/resolution_selection.js +++ b/ui/resolution_selection.js @@ -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'); @@ -67,7 +68,12 @@ shaka.ui.ResolutionSelection = class extends shaka.ui.SettingsMenu { /** @private */ updateResolutionSelection_() { /** @type {!Array.} */ - 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