From c5dc5f4e8fd068e5b05085c67168f6d97d46273e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Velad=20Galv=C3=A1n?= Date: Wed, 8 Jan 2025 19:55:33 +0100 Subject: [PATCH] fix: Fix select spatial audio when using selectAudioLanguage (#7846) --- lib/player.js | 5 +++-- ui/audio_language_selection.js | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/player.js b/lib/player.js index f19eb268ad..46211b114d 100644 --- a/lib/player.js +++ b/lib/player.js @@ -5271,10 +5271,11 @@ shaka.Player = class extends shaka.util.FakeEventTarget { * @param {number=} channelsCount * @param {number=} safeMargin * @param {string=} codec + * @param {boolean=} spatialAudio * @export */ selectAudioLanguage(language, role, channelsCount = 0, safeMargin = 0, - codec = '') { + codec = '', spatialAudio = false) { const selectMediaSourceMode = () => { this.currentAdaptationSetCriteria_ = new shaka.media.PreferenceBasedCriteria( @@ -5282,7 +5283,7 @@ shaka.Player = class extends shaka.util.FakeEventTarget { role || '', channelsCount || 0, /* hdrLevel= */ '', - /* spatialAudio= */ false, + spatialAudio || false, /* videoLayout= */ '', /* audioLabel= */ '', /* videoLabel= */ '', diff --git a/ui/audio_language_selection.js b/ui/audio_language_selection.js index 07d34bc4ab..f90232d89d 100644 --- a/ui/audio_language_selection.js +++ b/ui/audio_language_selection.js @@ -108,7 +108,7 @@ shaka.ui.AudioLanguageSelection = class extends shaka.ui.SettingsMenu { codec = track.audioCodec; } this.player.selectAudioLanguage(track.language, track.roles[0], - channelsCount, /* safeMargin= */ 0, codec); + channelsCount, /* safeMargin= */ 0, codec, track.spatialAudio); }