Skip to content

Commit

Permalink
fix: Fix selectVariantsByLabel using src= (#5154)
Browse files Browse the repository at this point in the history
  • Loading branch information
avelad authored and joeyparrish committed Apr 26, 2023
1 parent c0f9b71 commit 537591d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lib/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -4092,6 +4092,19 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
firstVariantWithLabel.language, '', 0, label);

this.chooseVariantAndSwitch_();
} else if (this.video_ && this.video_.audioTracks) {
const audioTracks = Array.from(this.video_.audioTracks);

let trackMatch = null;

for (const audioTrack of audioTracks) {
if (audioTrack.label == label) {
trackMatch = audioTrack;
}
}
if (trackMatch) {
this.switchHtml5Track_(trackMatch);
}
}
}

Expand Down

0 comments on commit 537591d

Please sign in to comment.