Skip to content

Commit

Permalink
fix: Fix select spatial audio when using selectAudioLanguage (#7846)
Browse files Browse the repository at this point in the history
  • Loading branch information
avelad authored Jan 8, 2025
1 parent 5a62db7 commit c5dc5f4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions lib/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -5271,18 +5271,19 @@ 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(
language,
role || '',
channelsCount || 0,
/* hdrLevel= */ '',
/* spatialAudio= */ false,
spatialAudio || false,
/* videoLayout= */ '',
/* audioLabel= */ '',
/* videoLabel= */ '',
Expand Down
2 changes: 1 addition & 1 deletion ui/audio_language_selection.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}


Expand Down

0 comments on commit c5dc5f4

Please sign in to comment.