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.
@@ -7139,6 +7139,17 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
7139
7139
  return this.host.config.optimizedPods !== false;
7140
7140
  }
7141
7141
  },
7142
+ {
7143
+ key: "nextAdRequestUrl",
7144
+ value: function nextAdRequestUrl(baseVastUrl) {
7145
+ if (this.optimizedPodsEnabled) {
7146
+ var remaining = Math.min(this.timing.getWallClockRemainingAdMs(), this.timing.getDurationBudgetRemainingMs());
7147
+ var breakDurationMs = remaining > 0 ? remaining : void 0;
7148
+ return this.host.generatePodVastUrl(baseVastUrl, breakDurationMs);
7149
+ }
7150
+ return this.host.generateVastUrls(baseVastUrl, 1)[0];
7151
+ }
7152
+ },
7142
7153
  {
7143
7154
  key: "attachImaEventListeners",
7144
7155
  value: function attachImaEventListeners() {
@@ -7308,7 +7319,7 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
7308
7319
  // ───────────────────────────────────────────────────────────────
7309
7320
  function handleAdStart(_marker) {
7310
7321
  return _async_to_generator(function() {
7311
- 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;
7322
+ var scheduled, tags, baseVastUrl, adBreakDurationMs, mode, currentMuted, currentVolume, podPlayed, firstAdUrl, usePreloadedAd, preloadedController, preloaded, adPlayer, preservedMuted, preservedVolume, adVolume, adPlayer1, adVolume1, error, fallbackPreloaded, ap, adVolume2, fallbackError;
7312
7323
  return _ts_generator(this, function(_state) {
7313
7324
  switch(_state.label){
7314
7325
  case 0:
@@ -7400,8 +7411,7 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
7400
7411
  if (this.debug) {
7401
7412
  console.log("[CONTINUOUS-FETCH] Generating new ad URLs...");
7402
7413
  }
7403
- firstAdUrlArray = this.host.generateVastUrls(baseVastUrl, 1);
7404
- firstAdUrl = firstAdUrlArray[0];
7414
+ firstAdUrl = this.nextAdRequestUrl(baseVastUrl);
7405
7415
  this.adRequestQueue = [];
7406
7416
  }
7407
7417
  if (!firstAdUrl) {
@@ -7458,11 +7468,13 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
7458
7468
  preloadedController.resume();
7459
7469
  this.timing.consecutiveFailures = 0;
7460
7470
  this.startContinuousFetching(baseVastUrl);
7461
- if (!this.preloadPool.active) {
7462
- this.preloadPool.active = true;
7463
- }
7464
- if (!this.preloadPool.isLoopRunning) {
7465
- this.preloadPool.preloadPoolLoop(baseVastUrl);
7471
+ if (!this.optimizedPodsEnabled) {
7472
+ if (!this.preloadPool.active) {
7473
+ this.preloadPool.active = true;
7474
+ }
7475
+ if (!this.preloadPool.isLoopRunning) {
7476
+ this.preloadPool.preloadPoolLoop(baseVastUrl);
7477
+ }
7466
7478
  }
7467
7479
  return [
7468
7480
  4,
@@ -7522,7 +7534,7 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
7522
7534
  case 11:
7523
7535
  this.timing.consecutiveFailures = 0;
7524
7536
  this.startContinuousFetching(baseVastUrl);
7525
- if (!this.preloadPool.active) {
7537
+ if (!this.optimizedPodsEnabled && !this.preloadPool.active) {
7526
7538
  this.preloadPool.startPreloadPool(baseVastUrl, []);
7527
7539
  }
7528
7540
  return [
@@ -7587,7 +7599,7 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
7587
7599
  this.swapToPreloadedAdPlayer(fallbackPreloaded.adController);
7588
7600
  this.timing.consecutiveFailures = 0;
7589
7601
  this.startContinuousFetching(baseVastUrl);
7590
- if (!this.preloadPool.active) {
7602
+ if (!this.optimizedPodsEnabled && !this.preloadPool.active) {
7591
7603
  this.preloadPool.active = true;
7592
7604
  this.preloadPool.preloadPoolLoop(baseVastUrl);
7593
7605
  }
@@ -7737,9 +7749,6 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
7737
7749
  if (podCount === 1) {
7738
7750
  this.continuousFetchingActive = true;
7739
7751
  this.startContinuousFetching(baseVastUrl);
7740
- if (!this.preloadPool.active) {
7741
- this.preloadPool.startPreloadPool(baseVastUrl, []);
7742
- }
7743
7752
  }
7744
7753
  return [
7745
7754
  2,
@@ -7880,7 +7889,7 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
7880
7889
  "continue"
7881
7890
  ];
7882
7891
  case 2:
7883
- newAdUrl = _this.host.generateVastUrls(baseVastUrl, 1)[0];
7892
+ newAdUrl = _this.nextAdRequestUrl(baseVastUrl);
7884
7893
  if (!(!newAdUrl || _this.timing.failedVastUrls.has(newAdUrl) || _this.timing.isUrlInCooldown(newAdUrl))) return [
7885
7894
  3,
7886
7895
  4