From 072acf05ff5d39c09da92986e8c48a69d5b1c241 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Velad=20Galv=C3=A1n?= Date: Wed, 4 Dec 2024 06:35:35 +0100 Subject: [PATCH] fix(Ads): Only display the secondary video if necessary (#7709) --- lib/ads/interstitial_ad_manager.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/ads/interstitial_ad_manager.js b/lib/ads/interstitial_ad_manager.js index 57f673457b..2a68418e9b 100644 --- a/lib/ads/interstitial_ad_manager.js +++ b/lib/ads/interstitial_ad_manager.js @@ -560,6 +560,7 @@ shaka.ads.InterstitialAdManager = class { video.style.width = '100%'; video.style.height = '100%'; video.style.backgroundColor = 'rgb(0, 0, 0)'; + video.style.display = 'none'; video.setAttribute('playsinline', ''); return video; } @@ -740,6 +741,7 @@ shaka.ads.InterstitialAdManager = class { await detachBasePlayerPromise; } if (!this.usingBaseVideo_) { + this.video_.style.display = ''; if (interstitial.overlay) { this.video_.loop = interstitial.loop; const viewport = interstitial.overlay.viewport; @@ -821,6 +823,7 @@ shaka.ads.InterstitialAdManager = class { this.adEventManager_.removeAll(); this.playingAd_ = false; if (!this.usingBaseVideo_) { + this.video_.style.display = 'none'; updateBaseVideoTime(); if (!this.baseVideo_.ended) { this.baseVideo_.play();