stormcloud-video-player 0.8.28 → 0.8.29

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.
@@ -7153,6 +7153,17 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
7153
7153
  return this.host.config.optimizedPods !== false;
7154
7154
  }
7155
7155
  },
7156
+ {
7157
+ key: "nextAdRequestUrl",
7158
+ value: function nextAdRequestUrl(baseVastUrl) {
7159
+ if (this.optimizedPodsEnabled) {
7160
+ var remaining = Math.min(this.timing.getWallClockRemainingAdMs(), this.timing.getDurationBudgetRemainingMs());
7161
+ var breakDurationMs = remaining > 0 ? remaining : void 0;
7162
+ return this.host.generatePodVastUrl(baseVastUrl, breakDurationMs);
7163
+ }
7164
+ return this.host.generateVastUrls(baseVastUrl, 1)[0];
7165
+ }
7166
+ },
7156
7167
  {
7157
7168
  key: "attachImaEventListeners",
7158
7169
  value: function attachImaEventListeners() {
@@ -7322,7 +7333,7 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
7322
7333
  // ───────────────────────────────────────────────────────────────
7323
7334
  function handleAdStart(_marker) {
7324
7335
  return _async_to_generator(function() {
7325
- var scheduled, tags, baseVastUrl, adBreakDurationMs, mode, currentMuted, currentVolume, podPlayed, firstAdUrl, usePreloadedAd, preloadedController, preloaded, firstAdUrlArray, adPlayer, preservedMuted, preservedVolume, adVolume, adPlayer1, adVolume1, error, fallbackPreloaded, ap, adVolume2, fallbackError;
7336
+ var scheduled, tags, baseVastUrl, adBreakDurationMs, mode, currentMuted, currentVolume, podPlayed, firstAdUrl, usePreloadedAd, preloadedController, preloaded, adPlayer, preservedMuted, preservedVolume, adVolume, adPlayer1, adVolume1, error, fallbackPreloaded, ap, adVolume2, fallbackError;
7326
7337
  return _ts_generator(this, function(_state) {
7327
7338
  switch(_state.label){
7328
7339
  case 0:
@@ -7414,8 +7425,7 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
7414
7425
  if (this.debug) {
7415
7426
  console.log("[CONTINUOUS-FETCH] Generating new ad URLs...");
7416
7427
  }
7417
- firstAdUrlArray = this.host.generateVastUrls(baseVastUrl, 1);
7418
- firstAdUrl = firstAdUrlArray[0];
7428
+ firstAdUrl = this.nextAdRequestUrl(baseVastUrl);
7419
7429
  this.adRequestQueue = [];
7420
7430
  }
7421
7431
  if (!firstAdUrl) {
@@ -7472,11 +7482,13 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
7472
7482
  preloadedController.resume();
7473
7483
  this.timing.consecutiveFailures = 0;
7474
7484
  this.startContinuousFetching(baseVastUrl);
7475
- if (!this.preloadPool.active) {
7476
- this.preloadPool.active = true;
7477
- }
7478
- if (!this.preloadPool.isLoopRunning) {
7479
- this.preloadPool.preloadPoolLoop(baseVastUrl);
7485
+ if (!this.optimizedPodsEnabled) {
7486
+ if (!this.preloadPool.active) {
7487
+ this.preloadPool.active = true;
7488
+ }
7489
+ if (!this.preloadPool.isLoopRunning) {
7490
+ this.preloadPool.preloadPoolLoop(baseVastUrl);
7491
+ }
7480
7492
  }
7481
7493
  return [
7482
7494
  4,
@@ -7536,7 +7548,7 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
7536
7548
  case 11:
7537
7549
  this.timing.consecutiveFailures = 0;
7538
7550
  this.startContinuousFetching(baseVastUrl);
7539
- if (!this.preloadPool.active) {
7551
+ if (!this.optimizedPodsEnabled && !this.preloadPool.active) {
7540
7552
  this.preloadPool.startPreloadPool(baseVastUrl, []);
7541
7553
  }
7542
7554
  return [
@@ -7601,7 +7613,7 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
7601
7613
  this.swapToPreloadedAdPlayer(fallbackPreloaded.adController);
7602
7614
  this.timing.consecutiveFailures = 0;
7603
7615
  this.startContinuousFetching(baseVastUrl);
7604
- if (!this.preloadPool.active) {
7616
+ if (!this.optimizedPodsEnabled && !this.preloadPool.active) {
7605
7617
  this.preloadPool.active = true;
7606
7618
  this.preloadPool.preloadPoolLoop(baseVastUrl);
7607
7619
  }
@@ -7751,9 +7763,6 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
7751
7763
  if (podCount === 1) {
7752
7764
  this.continuousFetchingActive = true;
7753
7765
  this.startContinuousFetching(baseVastUrl);
7754
- if (!this.preloadPool.active) {
7755
- this.preloadPool.startPreloadPool(baseVastUrl, []);
7756
- }
7757
7766
  }
7758
7767
  return [
7759
7768
  2,
@@ -7894,7 +7903,7 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
7894
7903
  "continue"
7895
7904
  ];
7896
7905
  case 2:
7897
- newAdUrl = _this.host.generateVastUrls(baseVastUrl, 1)[0];
7906
+ newAdUrl = _this.nextAdRequestUrl(baseVastUrl);
7898
7907
  if (!(!newAdUrl || _this.timing.failedVastUrls.has(newAdUrl) || _this.timing.isUrlInCooldown(newAdUrl))) return [
7899
7908
  3,
7900
7909
  4