Skip to content

Commit

Permalink
fix(Ads): Fix playback of preroll interstitial when the currentTime i…
Browse files Browse the repository at this point in the history
…s 0 (#7092)
  • Loading branch information
avelad committed Jul 24, 2024
1 parent dc5551e commit 8635ab2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/ads/interstitial_ad_manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ shaka.ads.InterstitialAdManager = class {
if (this.playingAd_) {
return;
}
const needPreRoll = this.lastTime_ == null;
const needPreRoll = this.lastTime_ == null || this.lastTime_ == 0;
this.lastTime_ = this.baseVideo_.currentTime;
const currentInterstitial = this.getCurrentInterstitial_(needPreRoll);
if (currentInterstitial) {
Expand Down
2 changes: 1 addition & 1 deletion test/test/assets/hls-interstitial/main.m3u8
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ s4.mp4
#EXTINF:4.000,
s5.mp4
#EXT-X-ENDLIST
#EXT-X-DATERANGE:ID="0",CLASS="com.apple.hls.interstitial",CUE="PRE",START-DATE="2000-01-01T00:00:02Z",X-ASSET-URI="ad.m3u8",X-RESTRICT="JUMP",X-RESUME-OFFSET=0.0
#EXT-X-DATERANGE:ID="0",CLASS="com.apple.hls.interstitial",CUE="PRE,ONCE",START-DATE="2000-01-01T00:00:02Z",X-ASSET-URI="ad.m3u8",X-RESTRICT="JUMP",X-RESUME-OFFSET=0.0
#EXT-X-DATERANGE:ID="1",CLASS="com.apple.hls.interstitial",CUE="ONCE",START-DATE="2000-01-01T00:00:04Z",X-ASSET-URI="ad.m3u8",X-RESTRICT="SKIP,JUMP",X-RESUME-OFFSET=6.0,X-PLAYOUT-LIMIT=15.0

0 comments on commit 8635ab2

Please sign in to comment.