stormcloud-video-player 0.8.11 → 0.8.13

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.js CHANGED
@@ -5197,7 +5197,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5197
5197
  }
5198
5198
  this.beginNewAdPod();
5199
5199
  this.podAssignedByPrefetch = true;
5200
- var urlsToPregenerate = 5;
5200
+ var urlsToPregenerate = 1;
5201
5201
  var generatedUrls = this.generateVastUrlsWithCorrelators(baseVastUrl, urlsToPregenerate);
5202
5202
  this.pendingAdBreak = _object_spread_props(_object_spread({
5203
5203
  marker: marker
@@ -5222,7 +5222,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5222
5222
  console.log("[PREFETCH] \uD83D\uDD04 Starting ad prefetch for upcoming ad break");
5223
5223
  console.log("[PREFETCH] \uD83D\uDCCB Pre-generated ".concat(generatedUrls.length, " VAST URLs"));
5224
5224
  }
5225
- this.startPreloadPool(baseVastUrl, generatedUrls.slice(0, this.maxPreloadPoolSize));
5225
+ this.startPreloadPool(baseVastUrl, generatedUrls.slice(0, 1), false);
5226
5226
  }
5227
5227
  },
5228
5228
  {
@@ -5240,6 +5240,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5240
5240
  {
5241
5241
  key: "startPreloadPool",
5242
5242
  value: function startPreloadPool(baseVastUrl, initialUrls) {
5243
+ var startLoopImmediately = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : true;
5243
5244
  if (this.preloadPoolActive) {
5244
5245
  if (this.config.debugAdTiming) {
5245
5246
  console.log("[PRELOAD-POOL] Already active, skipping duplicate start");
@@ -5273,7 +5274,11 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5273
5274
  }
5274
5275
  }
5275
5276
  }
5276
- this.preloadPoolLoop(baseVastUrl);
5277
+ if (startLoopImmediately) {
5278
+ this.preloadPoolLoop(baseVastUrl);
5279
+ } else if (this.config.debugAdTiming) {
5280
+ console.log("[PRELOAD-POOL] Pre-break mode: preloaded once, waiting for SCTE start to continue fetching");
5281
+ }
5277
5282
  }
5278
5283
  },
5279
5284
  {
@@ -5700,21 +5705,13 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5700
5705
  currentMuted = this.video.muted;
5701
5706
  currentVolume = this.video.volume;
5702
5707
  this.adPlayer.updateOriginalMutedState(currentMuted, currentVolume);
5703
- if (!this.video.muted) {
5704
- this.video.muted = true;
5705
- if (this.config.debugAdTiming) {
5706
- console.log("[StormcloudVideoPlayer] Muted video in handleAdStart");
5707
- }
5708
- }
5709
5708
  this.inAdBreak = true;
5710
5709
  this.currentAdBreakStartWallClockMs = Date.now();
5711
5710
  this.adBreakPlayedDurationMs = 0;
5712
5711
  this.currentAdIndex = 0;
5713
5712
  this.totalAdsInBreak = 0;
5714
5713
  this.adPodQueue = [];
5715
- this.showAds = true;
5716
- this.showPlaceholderLayer();
5717
- this.adPlayer.showPlaceholder();
5714
+ this.showAds = false;
5718
5715
  if (this.expectedAdBreakDurationMs == null && adBreakDurationMs != null) {
5719
5716
  this.expectedAdBreakDurationMs = adBreakDurationMs;
5720
5717
  }
@@ -5803,6 +5800,8 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5803
5800
  this.startContinuousFetching(baseVastUrl);
5804
5801
  if (!this.preloadPoolActive) {
5805
5802
  this.preloadPoolActive = true;
5803
+ }
5804
+ if (!this.preloadPoolLoopRunning) {
5806
5805
  this.preloadPoolLoop(baseVastUrl);
5807
5806
  }
5808
5807
  return [