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 a91ff67 commit 53dbbf2
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 @@ -4282,6 +4282,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 53dbbf2

Please sign in to comment.