Skip to content

Commit

Permalink
fix(Ads): Prevent playing the same ad twice (#7585)
Browse files Browse the repository at this point in the history
  • Loading branch information
avelad committed Nov 15, 2024
1 parent e25400c commit 2339612
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/ads/interstitial_ad_manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -464,8 +464,7 @@ shaka.ads.InterstitialAdManager = class {
this.lastTime_ - roundDecimals(interstitial.startTime);
if (difference > 0 &&
(difference <= 1 || !interstitial.canJump)) {
if (difference > 1 && lastPlayedAd &&
!lastPlayedAd.pre && !lastPlayedAd.post &&
if (lastPlayedAd && !lastPlayedAd.pre && !lastPlayedAd.post &&
lastPlayedAd.startTime >= interstitial.startTime) {
isValid = false;
} else {
Expand Down

0 comments on commit 2339612

Please sign in to comment.