stormcloud-video-player 0.8.11 → 0.8.12

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.
@@ -1,5 +1,5 @@
1
1
  import { Component } from 'react';
2
- import { S as StormcloudVideoPlayerConfig } from '../types-CRd8dgO8.cjs';
2
+ import { S as StormcloudVideoPlayerConfig } from '../types-BM5cceAy.cjs';
3
3
 
4
4
  interface HlsPlayerProps extends StormcloudVideoPlayerConfig {
5
5
  onMount?: (player: any) => void;
@@ -5213,7 +5213,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5213
5213
  }
5214
5214
  this.beginNewAdPod();
5215
5215
  this.podAssignedByPrefetch = true;
5216
- var urlsToPregenerate = 5;
5216
+ var urlsToPregenerate = 1;
5217
5217
  var generatedUrls = this.generateVastUrlsWithCorrelators(baseVastUrl, urlsToPregenerate);
5218
5218
  this.pendingAdBreak = _object_spread_props(_object_spread({
5219
5219
  marker: marker
@@ -5238,7 +5238,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5238
5238
  console.log("[PREFETCH] \uD83D\uDD04 Starting ad prefetch for upcoming ad break");
5239
5239
  console.log("[PREFETCH] \uD83D\uDCCB Pre-generated ".concat(generatedUrls.length, " VAST URLs"));
5240
5240
  }
5241
- this.startPreloadPool(baseVastUrl, generatedUrls.slice(0, this.maxPreloadPoolSize));
5241
+ this.startPreloadPool(baseVastUrl, generatedUrls.slice(0, 1), false);
5242
5242
  }
5243
5243
  },
5244
5244
  {
@@ -5256,6 +5256,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5256
5256
  {
5257
5257
  key: "startPreloadPool",
5258
5258
  value: function startPreloadPool(baseVastUrl, initialUrls) {
5259
+ var startLoopImmediately = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : true;
5259
5260
  if (this.preloadPoolActive) {
5260
5261
  if (this.config.debugAdTiming) {
5261
5262
  console.log("[PRELOAD-POOL] Already active, skipping duplicate start");
@@ -5289,7 +5290,11 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5289
5290
  }
5290
5291
  }
5291
5292
  }
5292
- this.preloadPoolLoop(baseVastUrl);
5293
+ if (startLoopImmediately) {
5294
+ this.preloadPoolLoop(baseVastUrl);
5295
+ } else if (this.config.debugAdTiming) {
5296
+ console.log("[PRELOAD-POOL] Pre-break mode: preloaded once, waiting for SCTE start to continue fetching");
5297
+ }
5293
5298
  }
5294
5299
  },
5295
5300
  {
@@ -5819,6 +5824,8 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5819
5824
  this.startContinuousFetching(baseVastUrl);
5820
5825
  if (!this.preloadPoolActive) {
5821
5826
  this.preloadPoolActive = true;
5827
+ }
5828
+ if (!this.preloadPoolLoopRunning) {
5822
5829
  this.preloadPoolLoop(baseVastUrl);
5823
5830
  }
5824
5831
  return [