stormcloud-video-player 0.3.9 → 0.3.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.cjs CHANGED
@@ -2149,6 +2149,12 @@ var StormcloudVideoPlayer = class {
2149
2149
  this.targetAdBreakDurationMs = null;
2150
2150
  this.isAdaptiveMode = false;
2151
2151
  this.failedVastUrls = /* @__PURE__ */ new Set();
2152
+ this.continuousFetchingActive = false;
2153
+ this.adRequestQueue = [];
2154
+ this.successfulAdRequests = [];
2155
+ this.maxPlaceholderDurationMs = 5e3;
2156
+ this.placeholderStartTimeMs = null;
2157
+ this.isShowingPlaceholder = false;
2152
2158
  initializePolyfills();
2153
2159
  const browserOverrides = getBrowserConfigOverrides();
2154
2160
  this.config = { ...config, ...browserOverrides };
@@ -2455,16 +2461,11 @@ var StormcloudVideoPlayer = class {
2455
2461
  return;
2456
2462
  }
2457
2463
  const remaining = this.getRemainingAdMs();
2458
- if (remaining > 500 && this.adPodQueue.length > 0) {
2459
- const nextPreloaded = this.findNextPreloadedAd();
2460
- if (nextPreloaded) {
2461
- this.currentAdIndex++;
2462
- this.playSingleAd(nextPreloaded).catch(() => {
2463
- this.handleAdPodComplete();
2464
- });
2465
- } else {
2466
- this.handleAdPodComplete();
2467
- }
2464
+ if (this.config.debugAdTiming) {
2465
+ console.log(`[CONTINUOUS-FETCH] content_resume event: remaining=${remaining}ms, queued ads=${this.adRequestQueue.length}`);
2466
+ }
2467
+ if (remaining > 500) {
2468
+ this.tryNextAvailableAd();
2468
2469
  } else {
2469
2470
  this.handleAdPodComplete();
2470
2471
  }
@@ -3064,155 +3065,240 @@ var StormcloudVideoPlayer = class {
3064
3065
  return true;
3065
3066
  }
3066
3067
  async handleAdStart(_marker) {
3067
- var _a;
3068
3068
  const scheduled = this.findCurrentOrNextBreak(
3069
3069
  this.video.currentTime * 1e3
3070
3070
  );
3071
3071
  const tags = this.selectVastTagsForBreak(scheduled);
3072
- let vastTagUrls = [];
3072
+ let baseVastUrl;
3073
3073
  if (this.apiVastTagUrl) {
3074
- let numberOfAds = 1;
3075
- if (this.isLiveStream) {
3076
- const adBreakDurationMs = _marker.durationSeconds != null ? _marker.durationSeconds * 1e3 : scheduled == null ? void 0 : scheduled.durationMs;
3077
- if (adBreakDurationMs != null && adBreakDurationMs > 0) {
3078
- this.isAdaptiveMode = true;
3079
- this.targetAdBreakDurationMs = adBreakDurationMs;
3080
- this.fetchedAdDurations.clear();
3081
- numberOfAds = 2;
3082
- if (this.config.debugAdTiming) {
3083
- console.log(
3084
- `[ADAPTIVE-POD] \u{1F4FA} LIVE MODE (ADAPTIVE): Target duration=${adBreakDurationMs}ms | Starting with ${numberOfAds} ads, will fetch actual durations and add more dynamically`
3085
- );
3086
- }
3087
- } else {
3088
- if (this.config.debugAdTiming) {
3089
- console.warn(
3090
- "[DEBUG-POD] \u26A0\uFE0F LIVE MODE: No duration available, defaulting to 1 ad"
3091
- );
3092
- }
3074
+ baseVastUrl = this.apiVastTagUrl;
3075
+ } else if (tags && tags.length > 0 && tags[0]) {
3076
+ baseVastUrl = tags[0];
3077
+ } else {
3078
+ return;
3079
+ }
3080
+ const adBreakDurationMs = _marker.durationSeconds != null ? _marker.durationSeconds * 1e3 : scheduled == null ? void 0 : scheduled.durationMs;
3081
+ if (this.isLiveStream && adBreakDurationMs != null && adBreakDurationMs > 0) {
3082
+ this.isAdaptiveMode = true;
3083
+ this.targetAdBreakDurationMs = adBreakDurationMs;
3084
+ this.fetchedAdDurations.clear();
3085
+ if (this.config.debugAdTiming) {
3086
+ console.log(
3087
+ `[CONTINUOUS-FETCH] \u{1F4FA} LIVE MODE: Target duration=${adBreakDurationMs}ms | Will continuously fetch ads during break`
3088
+ );
3089
+ }
3090
+ } else {
3091
+ this.isAdaptiveMode = false;
3092
+ this.targetAdBreakDurationMs = null;
3093
+ this.fetchedAdDurations.clear();
3094
+ if (this.config.debugAdTiming) {
3095
+ console.log(
3096
+ `[CONTINUOUS-FETCH] \u{1F3AC} VOD MODE: Using fixed ad strategy`
3097
+ );
3098
+ }
3099
+ }
3100
+ this.adPodAllUrls = [];
3101
+ this.preloadingAdUrls.clear();
3102
+ this.vastToMediaUrlMap.clear();
3103
+ this.preloadedMediaUrls.clear();
3104
+ this.preloadingMediaUrls.clear();
3105
+ this.failedVastUrls.clear();
3106
+ this.adRequestQueue = [];
3107
+ this.successfulAdRequests = [];
3108
+ this.continuousFetchingActive = true;
3109
+ this.isShowingPlaceholder = false;
3110
+ this.placeholderStartTimeMs = null;
3111
+ const currentMuted = this.video.muted;
3112
+ const currentVolume = this.video.volume;
3113
+ this.ima.updateOriginalMutedState(currentMuted, currentVolume);
3114
+ this.inAdBreak = true;
3115
+ this.currentAdIndex = 0;
3116
+ this.totalAdsInBreak = 1;
3117
+ this.adPodQueue = [];
3118
+ if (this.expectedAdBreakDurationMs == null && adBreakDurationMs != null) {
3119
+ this.expectedAdBreakDurationMs = adBreakDurationMs;
3120
+ this.currentAdBreakStartWallClockMs = Date.now();
3121
+ this.scheduleAdStopCountdown(this.expectedAdBreakDurationMs);
3122
+ }
3123
+ if (this.config.debugAdTiming) {
3124
+ console.log("[CONTINUOUS-FETCH] \u{1F680} Immediately requesting first ad...");
3125
+ }
3126
+ const firstAdUrlArray = this.generateVastUrlsWithCorrelators(baseVastUrl, 1);
3127
+ const firstAdUrl = firstAdUrlArray[0];
3128
+ if (!firstAdUrl) {
3129
+ if (this.config.debugAdTiming) {
3130
+ console.warn("[CONTINUOUS-FETCH] \u26A0\uFE0F Failed to generate first ad URL");
3131
+ }
3132
+ this.handleAdPodComplete();
3133
+ return;
3134
+ }
3135
+ try {
3136
+ await this.ima.requestAds(firstAdUrl);
3137
+ if (this.config.debugAdTiming) {
3138
+ console.log("[CONTINUOUS-FETCH] \u2705 First ad request successful, starting playback");
3139
+ }
3140
+ this.successfulAdRequests.push(firstAdUrl);
3141
+ this.currentAdIndex++;
3142
+ this.startContinuousFetching(baseVastUrl);
3143
+ await this.ima.play();
3144
+ } catch (error) {
3145
+ if (this.config.debugAdTiming) {
3146
+ console.warn("[CONTINUOUS-FETCH] \u26A0\uFE0F First ad request failed:", error);
3147
+ }
3148
+ this.failedVastUrls.add(firstAdUrl);
3149
+ this.startContinuousFetching(baseVastUrl);
3150
+ this.tryNextAvailableAd();
3151
+ }
3152
+ }
3153
+ startContinuousFetching(baseVastUrl) {
3154
+ if (!this.continuousFetchingActive) {
3155
+ return;
3156
+ }
3157
+ if (this.config.debugAdTiming) {
3158
+ console.log("[CONTINUOUS-FETCH] \u{1F504} Starting continuous ad fetching loop");
3159
+ }
3160
+ this.continuousFetchLoop(baseVastUrl);
3161
+ }
3162
+ async continuousFetchLoop(baseVastUrl) {
3163
+ while (this.continuousFetchingActive && this.inAdBreak) {
3164
+ const remaining = this.getRemainingAdMs();
3165
+ if (remaining <= 0) {
3166
+ if (this.config.debugAdTiming) {
3167
+ console.log("[CONTINUOUS-FETCH] \u23F9\uFE0F Ad break time expired, stopping fetch loop");
3093
3168
  }
3094
- } else {
3095
- this.isAdaptiveMode = false;
3096
- this.targetAdBreakDurationMs = null;
3097
- this.fetchedAdDurations.clear();
3098
- if (this.apiNumberAds && this.apiNumberAds > 1) {
3099
- numberOfAds = this.apiNumberAds;
3169
+ break;
3170
+ }
3171
+ if (this.adRequestQueue.length > 0) {
3172
+ if (this.config.debugAdTiming) {
3173
+ console.log(`[CONTINUOUS-FETCH] \u23F3 Already have ${this.adRequestQueue.length} ads queued, waiting...`);
3174
+ }
3175
+ await new Promise((resolve) => setTimeout(resolve, 2e3));
3176
+ continue;
3177
+ }
3178
+ const newAdUrl = this.generateVastUrlsWithCorrelators(baseVastUrl, 1)[0];
3179
+ if (!newAdUrl || this.failedVastUrls.has(newAdUrl)) {
3180
+ await new Promise((resolve) => setTimeout(resolve, 1e3));
3181
+ continue;
3182
+ }
3183
+ if (this.config.debugAdTiming) {
3184
+ console.log("[CONTINUOUS-FETCH] \u{1F4E1} Attempting to fetch additional ad...");
3185
+ }
3186
+ try {
3187
+ const response = await fetch(newAdUrl, { mode: "cors" });
3188
+ if (!response.ok) {
3189
+ throw new Error(`Failed to fetch VAST: ${response.status}`);
3190
+ }
3191
+ const xmlText = await response.text();
3192
+ const parser = new DOMParser();
3193
+ const xmlDoc = parser.parseFromString(xmlText, "text/xml");
3194
+ const mediaFiles = xmlDoc.querySelectorAll("MediaFile");
3195
+ if (mediaFiles.length === 0) {
3100
3196
  if (this.config.debugAdTiming) {
3101
- console.log(
3102
- `[DEBUG-POD] \u{1F3AC} VOD MODE (FIXED): Using number_ads=${numberOfAds} from API`
3103
- );
3197
+ console.log("[CONTINUOUS-FETCH] \u26A0\uFE0F VAST response has no media files, skipping");
3104
3198
  }
3199
+ this.failedVastUrls.add(newAdUrl);
3200
+ await new Promise((resolve) => setTimeout(resolve, 1e3));
3201
+ continue;
3105
3202
  }
3106
- }
3107
- if (numberOfAds > 1) {
3108
- vastTagUrls = this.generateVastUrlsWithCorrelators(
3109
- this.apiVastTagUrl,
3110
- numberOfAds
3111
- );
3112
3203
  if (this.config.debugAdTiming) {
3113
- console.log(
3114
- `[DEBUG-POD] \u{1F504} Generated ${vastTagUrls.length} initial VAST URLs with unique correlators`
3115
- );
3204
+ console.log("[CONTINUOUS-FETCH] \u2705 Successfully fetched new ad, adding to queue");
3116
3205
  }
3117
- } else {
3118
- vastTagUrls = [this.apiVastTagUrl];
3206
+ this.adRequestQueue.push(newAdUrl);
3207
+ this.totalAdsInBreak++;
3208
+ await new Promise((resolve) => setTimeout(resolve, 2e3));
3209
+ } catch (error) {
3210
+ if (this.config.debugAdTiming) {
3211
+ console.log("[CONTINUOUS-FETCH] \u274C Ad fetch failed:", error.message);
3212
+ }
3213
+ this.failedVastUrls.add(newAdUrl);
3214
+ await new Promise((resolve) => setTimeout(resolve, 3e3));
3119
3215
  }
3120
- } else if (tags && tags.length > 0) {
3121
- vastTagUrls = tags;
3122
- } else {
3216
+ }
3217
+ if (this.config.debugAdTiming) {
3218
+ console.log("[CONTINUOUS-FETCH] \u{1F6D1} Continuous fetch loop ended");
3219
+ }
3220
+ }
3221
+ stopContinuousFetching() {
3222
+ this.continuousFetchingActive = false;
3223
+ if (this.config.debugAdTiming) {
3224
+ console.log("[CONTINUOUS-FETCH] \u{1F6D1} Stopping continuous ad fetching");
3225
+ }
3226
+ }
3227
+ async tryNextAvailableAd() {
3228
+ const remaining = this.getRemainingAdMs();
3229
+ if (remaining <= 500) {
3230
+ if (this.config.debugAdTiming) {
3231
+ console.log("[CONTINUOUS-FETCH] \u23F9\uFE0F No time remaining, ending ad break");
3232
+ }
3233
+ this.handleAdPodComplete();
3123
3234
  return;
3124
3235
  }
3125
- if (vastTagUrls.length > 0) {
3126
- this.adPodAllUrls = [...vastTagUrls];
3127
- this.preloadingAdUrls.clear();
3128
- this.vastToMediaUrlMap.clear();
3129
- this.preloadedMediaUrls.clear();
3130
- this.preloadingMediaUrls.clear();
3131
- this.failedVastUrls.clear();
3132
- const currentMuted = this.video.muted;
3133
- const currentVolume = this.video.volume;
3134
- this.ima.updateOriginalMutedState(currentMuted, currentVolume);
3135
- this.inAdBreak = true;
3136
- this.currentAdIndex = 0;
3137
- this.totalAdsInBreak = vastTagUrls.length;
3138
- this.adPodQueue = [...vastTagUrls];
3139
- if (this.isAdaptiveMode) {
3236
+ if (this.adRequestQueue.length > 0) {
3237
+ const nextAdUrl = this.adRequestQueue.shift();
3238
+ if (nextAdUrl) {
3140
3239
  if (this.config.debugAdTiming) {
3141
- console.log("[ADAPTIVE-POD] \u{1F680} Preloading first 2 ads before starting playback...");
3142
- }
3143
- try {
3144
- const adsToPreloadBeforeStart = Math.min(2, this.adPodAllUrls.length);
3145
- for (let i = 0; i < adsToPreloadBeforeStart; i++) {
3146
- const url = this.adPodAllUrls[i];
3147
- if (url) {
3148
- await this.preloadSingleAd(url);
3149
- if (this.config.debugAdTiming) {
3150
- console.log(`[ADAPTIVE-POD] \u2705 Preloaded ad ${i + 1}/${adsToPreloadBeforeStart}`);
3151
- }
3152
- }
3153
- }
3154
- if (this.config.debugAdTiming) {
3155
- console.log("[ADAPTIVE-POD] \u{1F3AC} First ads preloaded, starting playback immediately");
3156
- }
3157
- } catch (error) {
3158
- if (this.config.debugAdTiming) {
3159
- console.warn(
3160
- "[ADAPTIVE-POD] \u26A0\uFE0F Error preloading initial ads:",
3161
- error
3162
- );
3163
- }
3240
+ console.log("[CONTINUOUS-FETCH] \u{1F3AC} Playing next queued ad");
3164
3241
  }
3165
- this.preloadAllAdsInBackground().catch((error) => {
3166
- if (this.config.debugAdTiming) {
3167
- console.warn(
3168
- "[ADAPTIVE-POD] Error in background preloading:",
3169
- error
3170
- );
3171
- }
3172
- });
3173
- await this.playAdPod();
3174
- } else {
3175
- this.preloadAllAdsInBackground().catch((error) => {
3176
- if (this.config.debugAdTiming) {
3177
- console.warn(
3178
- "[StormcloudVideoPlayer] Error in background preloading:",
3179
- error
3180
- );
3181
- }
3242
+ this.currentAdIndex++;
3243
+ await this.playSingleAd(nextAdUrl).catch(() => {
3244
+ this.tryNextAvailableAd();
3182
3245
  });
3183
- await this.playAdPod();
3246
+ return;
3184
3247
  }
3185
3248
  }
3186
- if (this.expectedAdBreakDurationMs == null && (scheduled == null ? void 0 : scheduled.durationMs) != null) {
3187
- this.expectedAdBreakDurationMs = scheduled.durationMs;
3188
- this.currentAdBreakStartWallClockMs = (_a = this.currentAdBreakStartWallClockMs) != null ? _a : Date.now();
3189
- this.scheduleAdStopCountdown(this.expectedAdBreakDurationMs);
3249
+ if (!this.isShowingPlaceholder && remaining > 1e3) {
3250
+ this.showPlaceholderAndWaitForAds();
3251
+ } else {
3252
+ if (this.config.debugAdTiming) {
3253
+ console.log("[CONTINUOUS-FETCH] \u23F9\uFE0F No more ads available, ending ad break");
3254
+ }
3255
+ this.handleAdPodComplete();
3190
3256
  }
3191
3257
  }
3192
- async playAdPod() {
3193
- if (this.adPodQueue.length === 0) {
3258
+ async showPlaceholderAndWaitForAds() {
3259
+ const remaining = this.getRemainingAdMs();
3260
+ const waitTime = Math.min(this.maxPlaceholderDurationMs, remaining);
3261
+ if (waitTime < 1e3) {
3262
+ this.handleAdPodComplete();
3194
3263
  return;
3195
3264
  }
3196
- const waitTime = this.isAdaptiveMode ? 50 : 500;
3197
- await new Promise((resolve) => setTimeout(resolve, waitTime));
3198
- const firstPreloaded = this.findNextPreloadedAd();
3199
- if (!firstPreloaded) {
3200
- const firstAd = this.adPodQueue.shift();
3201
- if (firstAd) {
3202
- this.currentAdIndex++;
3203
- try {
3204
- await this.playSingleAd(firstAd);
3205
- } catch (error) {
3206
- return;
3265
+ if (this.config.debugAdTiming) {
3266
+ console.log(`[CONTINUOUS-FETCH] \u2B1B Showing black placeholder for ${waitTime}ms while waiting for ads`);
3267
+ }
3268
+ this.isShowingPlaceholder = true;
3269
+ this.placeholderStartTimeMs = Date.now();
3270
+ this.ima.showPlaceholder();
3271
+ const checkInterval = 500;
3272
+ const maxChecks = Math.floor(waitTime / checkInterval);
3273
+ for (let i = 0; i < maxChecks; i++) {
3274
+ await new Promise((resolve) => setTimeout(resolve, checkInterval));
3275
+ if (!this.inAdBreak) {
3276
+ return;
3277
+ }
3278
+ if (this.adRequestQueue.length > 0) {
3279
+ if (this.config.debugAdTiming) {
3280
+ console.log("[CONTINUOUS-FETCH] \u2705 New ad became available during placeholder");
3281
+ }
3282
+ this.isShowingPlaceholder = false;
3283
+ this.placeholderStartTimeMs = null;
3284
+ this.ima.hidePlaceholder();
3285
+ const nextAdUrl = this.adRequestQueue.shift();
3286
+ if (nextAdUrl) {
3287
+ this.currentAdIndex++;
3288
+ await this.playSingleAd(nextAdUrl).catch(() => {
3289
+ this.tryNextAvailableAd();
3290
+ });
3207
3291
  }
3292
+ return;
3208
3293
  }
3209
- return;
3210
3294
  }
3211
- this.currentAdIndex++;
3212
- try {
3213
- await this.playSingleAd(firstPreloaded);
3214
- } catch (error) {
3295
+ if (this.config.debugAdTiming) {
3296
+ console.log("[CONTINUOUS-FETCH] \u23F0 Placeholder timeout reached, no ads fetched");
3215
3297
  }
3298
+ this.isShowingPlaceholder = false;
3299
+ this.placeholderStartTimeMs = null;
3300
+ this.ima.hidePlaceholder();
3301
+ this.handleAdPodComplete();
3216
3302
  }
3217
3303
  findCurrentOrNextBreak(nowMs) {
3218
3304
  var _a;
@@ -3372,10 +3458,18 @@ var StormcloudVideoPlayer = class {
3372
3458
  this.clearAdRequestWatchdog();
3373
3459
  this.clearAdFailsafeTimer();
3374
3460
  this.activeAdRequestToken = null;
3461
+ this.stopContinuousFetching();
3462
+ if (this.isShowingPlaceholder) {
3463
+ this.ima.hidePlaceholder();
3464
+ this.isShowingPlaceholder = false;
3465
+ this.placeholderStartTimeMs = null;
3466
+ }
3375
3467
  this.preloadingAdUrls.clear();
3376
3468
  this.vastToMediaUrlMap.clear();
3377
3469
  this.preloadedMediaUrls.clear();
3378
3470
  this.preloadingMediaUrls.clear();
3471
+ this.adRequestQueue = [];
3472
+ this.successfulAdRequests = [];
3379
3473
  this.inAdBreak = false;
3380
3474
  this.expectedAdBreakDurationMs = void 0;
3381
3475
  this.currentAdBreakStartWallClockMs = void 0;
@@ -3402,61 +3496,14 @@ var StormcloudVideoPlayer = class {
3402
3496
  }
3403
3497
  }
3404
3498
  handleAdFailure() {
3405
- const remaining = this.getRemainingAdMs();
3406
- const availableAds = this.adPodQueue.filter((url) => !this.failedVastUrls.has(url)).length;
3407
- if (remaining > 500 && availableAds > 0) {
3408
- if (this.isAdaptiveMode && this.currentAdIndex <= 1) {
3409
- console.log("[ADAPTIVE-POD] \u23F3 First ad failed, waiting for sequential preload to catch up...");
3410
- setTimeout(() => {
3411
- this.tryNextAdWithRetry(0);
3412
- }, 1500);
3413
- return;
3414
- }
3415
- const nextPreloaded = this.findNextPreloadedAd();
3416
- if (nextPreloaded) {
3417
- this.currentAdIndex++;
3418
- this.playSingleAd(nextPreloaded).catch(() => {
3419
- this.handleAdPodComplete();
3420
- });
3421
- return;
3422
- }
3423
- }
3424
- console.error("[AD-ERROR] All ads failed or time expired. Failed URLs:", this.failedVastUrls.size);
3425
- this.handleAdPodComplete();
3426
- }
3427
- tryNextAdWithRetry(retryCount) {
3428
- const maxRetries = 3;
3429
3499
  const remaining = this.getRemainingAdMs();
3430
3500
  if (this.config.debugAdTiming) {
3431
- console.log(
3432
- `[ADAPTIVE-POD] \u{1F50D} Retry attempt ${retryCount}: remaining=${remaining}ms, queue=${this.adPodQueue.length}, totalAds=${this.totalAdsInBreak}`
3433
- );
3434
- }
3435
- if (remaining <= 500 || this.adPodQueue.length === 0) {
3436
- console.log("[ADAPTIVE-POD] \u23F9\uFE0F No more time or ads available");
3437
- this.handleAdPodComplete();
3438
- return;
3501
+ console.log(`[CONTINUOUS-FETCH] Ad failure: remaining=${remaining}ms, queued ads=${this.adRequestQueue.length}`);
3439
3502
  }
3440
- const nextPreloaded = this.findNextPreloadedAd();
3441
- if (nextPreloaded) {
3442
- this.currentAdIndex++;
3443
- console.log(
3444
- `[ADAPTIVE-POD] \u2705 Found preloaded ad after retry ${retryCount}, playing (${this.currentAdIndex}/${this.totalAdsInBreak})`
3445
- );
3446
- this.playSingleAd(nextPreloaded).catch(() => {
3447
- this.handleAdPodComplete();
3448
- });
3449
- } else if (retryCount < maxRetries) {
3450
- console.log(
3451
- `[ADAPTIVE-POD] \u23F3 No preloaded ads yet (queue has ${this.adPodQueue.length} URLs), retry ${retryCount + 1}/${maxRetries} in 1s...`
3452
- );
3453
- setTimeout(() => {
3454
- this.tryNextAdWithRetry(retryCount + 1);
3455
- }, 1e3);
3503
+ if (remaining > 500) {
3504
+ this.tryNextAvailableAd();
3456
3505
  } else {
3457
- console.log(
3458
- `[ADAPTIVE-POD] \u274C Max retries reached, no preloaded ads available (queue=${this.adPodQueue.length} URLs)`
3459
- );
3506
+ console.error("[AD-ERROR] Ad failed and no time remaining. Failed URLs:", this.failedVastUrls.size);
3460
3507
  this.handleAdPodComplete();
3461
3508
  }
3462
3509
  }
@@ -4054,6 +4101,7 @@ var StormcloudVideoPlayer = class {
4054
4101
  }
4055
4102
  destroy() {
4056
4103
  var _a, _b;
4104
+ this.stopContinuousFetching();
4057
4105
  this.clearAdStartTimer();
4058
4106
  this.clearAdStopTimer();
4059
4107
  this.clearAdFailsafeTimer();
@@ -4068,6 +4116,8 @@ var StormcloudVideoPlayer = class {
4068
4116
  this.preloadedMediaUrls.clear();
4069
4117
  this.preloadingMediaUrls.clear();
4070
4118
  this.adPodAllUrls = [];
4119
+ this.adRequestQueue = [];
4120
+ this.successfulAdRequests = [];
4071
4121
  }
4072
4122
  };
4073
4123