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.
@@ -7189,6 +7189,17 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
7189
7189
  return this.host.config.optimizedPods !== false;
7190
7190
  }
7191
7191
  },
7192
+ {
7193
+ key: "nextAdRequestUrl",
7194
+ value: function nextAdRequestUrl(baseVastUrl) {
7195
+ if (this.optimizedPodsEnabled) {
7196
+ var remaining = Math.min(this.timing.getWallClockRemainingAdMs(), this.timing.getDurationBudgetRemainingMs());
7197
+ var breakDurationMs = remaining > 0 ? remaining : void 0;
7198
+ return this.host.generatePodVastUrl(baseVastUrl, breakDurationMs);
7199
+ }
7200
+ return this.host.generateVastUrls(baseVastUrl, 1)[0];
7201
+ }
7202
+ },
7192
7203
  {
7193
7204
  key: "attachImaEventListeners",
7194
7205
  value: function attachImaEventListeners() {
@@ -7358,7 +7369,7 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
7358
7369
  // ───────────────────────────────────────────────────────────────
7359
7370
  function handleAdStart(_marker) {
7360
7371
  return _async_to_generator(function() {
7361
- 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;
7372
+ var scheduled, tags, baseVastUrl, adBreakDurationMs, mode, currentMuted, currentVolume, podPlayed, firstAdUrl, usePreloadedAd, preloadedController, preloaded, adPlayer, preservedMuted, preservedVolume, adVolume, adPlayer1, adVolume1, error, fallbackPreloaded, ap, adVolume2, fallbackError;
7362
7373
  return _ts_generator(this, function(_state) {
7363
7374
  switch(_state.label){
7364
7375
  case 0:
@@ -7450,8 +7461,7 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
7450
7461
  if (this.debug) {
7451
7462
  console.log("[CONTINUOUS-FETCH] Generating new ad URLs...");
7452
7463
  }
7453
- firstAdUrlArray = this.host.generateVastUrls(baseVastUrl, 1);
7454
- firstAdUrl = firstAdUrlArray[0];
7464
+ firstAdUrl = this.nextAdRequestUrl(baseVastUrl);
7455
7465
  this.adRequestQueue = [];
7456
7466
  }
7457
7467
  if (!firstAdUrl) {
@@ -7508,11 +7518,13 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
7508
7518
  preloadedController.resume();
7509
7519
  this.timing.consecutiveFailures = 0;
7510
7520
  this.startContinuousFetching(baseVastUrl);
7511
- if (!this.preloadPool.active) {
7512
- this.preloadPool.active = true;
7513
- }
7514
- if (!this.preloadPool.isLoopRunning) {
7515
- this.preloadPool.preloadPoolLoop(baseVastUrl);
7521
+ if (!this.optimizedPodsEnabled) {
7522
+ if (!this.preloadPool.active) {
7523
+ this.preloadPool.active = true;
7524
+ }
7525
+ if (!this.preloadPool.isLoopRunning) {
7526
+ this.preloadPool.preloadPoolLoop(baseVastUrl);
7527
+ }
7516
7528
  }
7517
7529
  return [
7518
7530
  4,
@@ -7572,7 +7584,7 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
7572
7584
  case 11:
7573
7585
  this.timing.consecutiveFailures = 0;
7574
7586
  this.startContinuousFetching(baseVastUrl);
7575
- if (!this.preloadPool.active) {
7587
+ if (!this.optimizedPodsEnabled && !this.preloadPool.active) {
7576
7588
  this.preloadPool.startPreloadPool(baseVastUrl, []);
7577
7589
  }
7578
7590
  return [
@@ -7637,7 +7649,7 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
7637
7649
  this.swapToPreloadedAdPlayer(fallbackPreloaded.adController);
7638
7650
  this.timing.consecutiveFailures = 0;
7639
7651
  this.startContinuousFetching(baseVastUrl);
7640
- if (!this.preloadPool.active) {
7652
+ if (!this.optimizedPodsEnabled && !this.preloadPool.active) {
7641
7653
  this.preloadPool.active = true;
7642
7654
  this.preloadPool.preloadPoolLoop(baseVastUrl);
7643
7655
  }
@@ -7787,9 +7799,6 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
7787
7799
  if (podCount === 1) {
7788
7800
  this.continuousFetchingActive = true;
7789
7801
  this.startContinuousFetching(baseVastUrl);
7790
- if (!this.preloadPool.active) {
7791
- this.preloadPool.startPreloadPool(baseVastUrl, []);
7792
- }
7793
7802
  }
7794
7803
  return [
7795
7804
  2,
@@ -7930,7 +7939,7 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
7930
7939
  "continue"
7931
7940
  ];
7932
7941
  case 2:
7933
- newAdUrl = _this.host.generateVastUrls(baseVastUrl, 1)[0];
7942
+ newAdUrl = _this.nextAdRequestUrl(baseVastUrl);
7934
7943
  if (!(!newAdUrl || _this.timing.failedVastUrls.has(newAdUrl) || _this.timing.isUrlInCooldown(newAdUrl))) return [
7935
7944
  3,
7936
7945
  4