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 6eb138d commit 68c6e7a
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 @@ -4064,6 +4064,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 68c6e7a

Please sign in to comment.