diff --git a/lib/player.js b/lib/player.js index d3169e47b7..8752ecb68d 100644 --- a/lib/player.js +++ b/lib/player.js @@ -6299,6 +6299,7 @@ shaka.Player = class extends shaka.util.FakeEventTarget { } // if (keyIds.size) if (tracksChanged) { + this.onTracksChanged_(); const variantsUpdated = this.updateAbrManagerVariants_(); if (!variantsUpdated) { return; @@ -6310,10 +6311,6 @@ shaka.Player = class extends shaka.util.FakeEventTarget { shaka.log.debug('Choosing new streams after key status changed'); this.chooseVariantAndSwitch_(); } - - if (tracksChanged) { - this.onTracksChanged_(); - } } /**