From 259f0f70b12c420d968571457bb2fb2462e98a60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Velad=20Galv=C3=A1n?= Date: Mon, 13 Mar 2023 16:00:19 +0100 Subject: [PATCH] fix(Ads): Fix usage of EventManager on CS (#5084) --- lib/ads/client_side_ad_manager.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ads/client_side_ad_manager.js b/lib/ads/client_side_ad_manager.js index 2a35e2c5b8..2ae0ac97e8 100644 --- a/lib/ads/client_side_ad_manager.js +++ b/lib/ads/client_side_ad_manager.js @@ -219,9 +219,9 @@ shaka.ads.ClientSideAdManager = class { // seen the ads actually play until requestAds() is called. // Note: We listen for a play event to avoid autoplay issues that might // crash IMA. - this.video_.addEventListener('play', () => { + this.eventManager_.listenOnce(this.video_, 'play', () => { this.imaAdsManager_.start(); - }, {once: true}); + }); } catch (adError) { // If there was a problem with the VAST response, // we we won't be getting an ad. Hide ad UI if we showed it already