Skip to content

Commit

Permalink
fix: Fix selectVariantsByLabel using src= (shaka-project#5154)
Browse files Browse the repository at this point in the history
  • Loading branch information
avelad committed Apr 18, 2023
1 parent 49ed4ab commit e7d94f7
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lib/player.js
Expand Up @@ -4312,6 +4312,19 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
firstVariantWithLabel.language, '', 0, label);

this.chooseVariantAndSwitch_(clearBuffer, safeMargin);
} 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 e7d94f7

Please sign in to comment.