diff --git a/lib/ads/ad_manager.js b/lib/ads/ad_manager.js index a0430c4363..65ca694ac3 100644 --- a/lib/ads/ad_manager.js +++ b/lib/ads/ad_manager.js @@ -438,21 +438,13 @@ shaka.ads.AdManager = class extends shaka.util.FakeEventTarget { if (this.csAdManager_) { this.csAdManager_.stop(); } + if (this.ssAdManager_) { + this.ssAdManager_.stop(); + } this.dispatchEvent( new shaka.util.FakeEvent(shaka.ads.AdManager.AD_STOPPED)); - // TODO: - // For SS DAI streams, if a different asset gets unloaded as - // part of the process - // of loading a DAI asset, stream manager state gets reset and we - // don't get any ad events. - // We need to figure out if it makes sense to stop the SS - // manager on unload, and, if it does, find - // a way to do it safely. - // if (this.ssAdManager_) { - // this.ssAdManager_.stop(); - // } this.stats_ = new shaka.ads.AdsStats(); } diff --git a/lib/ads/server_side_ad_manager.js b/lib/ads/server_side_ad_manager.js index 28be4b3ee7..191a0e5ea8 100644 --- a/lib/ads/server_side_ad_manager.js +++ b/lib/ads/server_side_ad_manager.js @@ -201,7 +201,15 @@ shaka.ads.ServerSideAdManager = class { * Resets the stream manager and removes any continuous polling. */ stop() { - this.streamManager_.reset(); + // TODO: + // For SS DAI streams, if a different asset gets unloaded as + // part of the process + // of loading a DAI asset, stream manager state gets reset and we + // don't get any ad events. + // We need to figure out if it makes sense to stop the SS + // manager on unload, and, if it does, find + // a way to do it safely. + // this.streamManager_.reset(); this.backupUrl_ = ''; this.snapForwardTime_ = null; }