Skip to content

Commit

Permalink
fix(Ads): Only display the secondary video if necessary (#7709)
Browse files Browse the repository at this point in the history
  • Loading branch information
avelad authored Dec 4, 2024
1 parent a1e2f0a commit 072acf0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/ads/interstitial_ad_manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 072acf0

Please sign in to comment.