diff --git a/lib/player.js b/lib/player.js index a19ac1ab36..a8607bcf2b 100644 --- a/lib/player.js +++ b/lib/player.js @@ -1378,6 +1378,10 @@ shaka.Player = class extends shaka.util.FakeEventTarget { this.preloadDueAdManagerTimer_.stop(); } + if (this.cmcdManager_) { + this.cmcdManager_.reset(); + } + if (this.cmsdManager_) { this.cmsdManager_.reset(); } diff --git a/lib/util/cmcd_manager.js b/lib/util/cmcd_manager.js index 7cb36db1b4..6eb5bd4f9a 100644 --- a/lib/util/cmcd_manager.js +++ b/lib/util/cmcd_manager.js @@ -63,6 +63,16 @@ shaka.util.CmcdManager = class { this.config_ = config; } + + /** + * Resets the CmcdManager. + */ + reset() { + this.playbackStarted_ = false; + this.buffering_ = true; + this.starved_ = false; + } + /** * Set the buffering state *