From 375385bd106d93b04bf8a403679b427a0e4a16e7 Mon Sep 17 00:00:00 2001 From: brandonocasey Date: Tue, 6 Apr 2021 12:22:24 -0400 Subject: [PATCH 1/2] fix: always have an enable audio track --- .../control-bar/audio-track-controls/audio-track-menu-item.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/js/control-bar/audio-track-controls/audio-track-menu-item.js b/src/js/control-bar/audio-track-controls/audio-track-menu-item.js index a8933d6c3b..161ae31396 100644 --- a/src/js/control-bar/audio-track-controls/audio-track-menu-item.js +++ b/src/js/control-bar/audio-track-controls/audio-track-menu-item.js @@ -83,7 +83,9 @@ class AudioTrackMenuItem extends MenuItem { for (let i = 0; i < tracks.length; i++) { const track = tracks[i]; - track.enabled = track === this.track; + if (track === this.track) { + track.enabled = true; + } } } From 9efc19a046e7a509152c5b004f0614841bc89215 Mon Sep 17 00:00:00 2001 From: brandonocasey Date: Tue, 6 Apr 2021 12:35:54 -0400 Subject: [PATCH 2/2] better change --- .../audio-track-controls/audio-track-menu-item.js | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/js/control-bar/audio-track-controls/audio-track-menu-item.js b/src/js/control-bar/audio-track-controls/audio-track-menu-item.js index 161ae31396..86dfe0f010 100644 --- a/src/js/control-bar/audio-track-controls/audio-track-menu-item.js +++ b/src/js/control-bar/audio-track-controls/audio-track-menu-item.js @@ -76,17 +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]; - - if (track === this.track) { - track.enabled = true; - } - } + // the audio track list will automatically toggle other tracks + // off for us. + this.track.enabled = true; } /**