stormcloud-video-player 0.8.27 → 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.
@@ -1294,7 +1294,18 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
1294
1294
  // IMA event listeners
1295
1295
  // ───────────────────────────────────────────────────────────────
1296
1296
  function get() {
1297
- return !!this.host.config.optimizedPods;
1297
+ return this.host.config.optimizedPods !== false;
1298
+ }
1299
+ },
1300
+ {
1301
+ key: "nextAdRequestUrl",
1302
+ value: function nextAdRequestUrl(baseVastUrl) {
1303
+ if (this.optimizedPodsEnabled) {
1304
+ var remaining = Math.min(this.timing.getWallClockRemainingAdMs(), this.timing.getDurationBudgetRemainingMs());
1305
+ var breakDurationMs = remaining > 0 ? remaining : void 0;
1306
+ return this.host.generatePodVastUrl(baseVastUrl, breakDurationMs);
1307
+ }
1308
+ return this.host.generateVastUrls(baseVastUrl, 1)[0];
1298
1309
  }
1299
1310
  },
1300
1311
  {
@@ -1466,7 +1477,7 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
1466
1477
  // ───────────────────────────────────────────────────────────────
1467
1478
  function handleAdStart(_marker) {
1468
1479
  return _async_to_generator(function() {
1469
- 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;
1480
+ var scheduled, tags, baseVastUrl, adBreakDurationMs, mode, currentMuted, currentVolume, podPlayed, firstAdUrl, usePreloadedAd, preloadedController, preloaded, adPlayer, preservedMuted, preservedVolume, adVolume, adPlayer1, adVolume1, error, fallbackPreloaded, ap, adVolume2, fallbackError;
1470
1481
  return _ts_generator(this, function(_state) {
1471
1482
  switch(_state.label){
1472
1483
  case 0:
@@ -1558,8 +1569,7 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
1558
1569
  if (this.debug) {
1559
1570
  console.log("[CONTINUOUS-FETCH] Generating new ad URLs...");
1560
1571
  }
1561
- firstAdUrlArray = this.host.generateVastUrls(baseVastUrl, 1);
1562
- firstAdUrl = firstAdUrlArray[0];
1572
+ firstAdUrl = this.nextAdRequestUrl(baseVastUrl);
1563
1573
  this.adRequestQueue = [];
1564
1574
  }
1565
1575
  if (!firstAdUrl) {
@@ -1616,11 +1626,13 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
1616
1626
  preloadedController.resume();
1617
1627
  this.timing.consecutiveFailures = 0;
1618
1628
  this.startContinuousFetching(baseVastUrl);
1619
- if (!this.preloadPool.active) {
1620
- this.preloadPool.active = true;
1621
- }
1622
- if (!this.preloadPool.isLoopRunning) {
1623
- this.preloadPool.preloadPoolLoop(baseVastUrl);
1629
+ if (!this.optimizedPodsEnabled) {
1630
+ if (!this.preloadPool.active) {
1631
+ this.preloadPool.active = true;
1632
+ }
1633
+ if (!this.preloadPool.isLoopRunning) {
1634
+ this.preloadPool.preloadPoolLoop(baseVastUrl);
1635
+ }
1624
1636
  }
1625
1637
  return [
1626
1638
  4,
@@ -1680,7 +1692,7 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
1680
1692
  case 11:
1681
1693
  this.timing.consecutiveFailures = 0;
1682
1694
  this.startContinuousFetching(baseVastUrl);
1683
- if (!this.preloadPool.active) {
1695
+ if (!this.optimizedPodsEnabled && !this.preloadPool.active) {
1684
1696
  this.preloadPool.startPreloadPool(baseVastUrl, []);
1685
1697
  }
1686
1698
  return [
@@ -1745,7 +1757,7 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
1745
1757
  this.swapToPreloadedAdPlayer(fallbackPreloaded.adController);
1746
1758
  this.timing.consecutiveFailures = 0;
1747
1759
  this.startContinuousFetching(baseVastUrl);
1748
- if (!this.preloadPool.active) {
1760
+ if (!this.optimizedPodsEnabled && !this.preloadPool.active) {
1749
1761
  this.preloadPool.active = true;
1750
1762
  this.preloadPool.preloadPoolLoop(baseVastUrl);
1751
1763
  }
@@ -1895,9 +1907,6 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
1895
1907
  if (podCount === 1) {
1896
1908
  this.continuousFetchingActive = true;
1897
1909
  this.startContinuousFetching(baseVastUrl);
1898
- if (!this.preloadPool.active) {
1899
- this.preloadPool.startPreloadPool(baseVastUrl, []);
1900
- }
1901
1910
  }
1902
1911
  return [
1903
1912
  2,
@@ -2038,7 +2047,7 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
2038
2047
  "continue"
2039
2048
  ];
2040
2049
  case 2:
2041
- newAdUrl = _this.host.generateVastUrls(baseVastUrl, 1)[0];
2050
+ newAdUrl = _this.nextAdRequestUrl(baseVastUrl);
2042
2051
  if (!(!newAdUrl || _this.timing.failedVastUrls.has(newAdUrl) || _this.timing.isUrlInCooldown(newAdUrl))) return [
2043
2052
  3,
2044
2053
  4