Skip to content

Commit

Permalink
fix: always have an enabled audio track when switching (#7163)
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonocasey committed Apr 6, 2021
1 parent 17a6147 commit 4707ce8
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/js/control-bar/audio-track-controls/audio-track-menu-item.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,11 @@ class AudioTrackMenuItem extends MenuItem {
* @listens click
*/
handleClick(event) {
const tracks = this.player_.audioTracks();

super.handleClick(event);

for (let i = 0; i < tracks.length; i++) {
const track = tracks[i];

track.enabled = track === this.track;
}
// the audio track list will automatically toggle other tracks
// off for us.
this.track.enabled = true;
}

/**
Expand Down

0 comments on commit 4707ce8

Please sign in to comment.