stormcloud-video-player 0.5.26 → 0.5.27

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.
@@ -4315,7 +4315,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4315
4315
  case 0:
4316
4316
  _this = this;
4317
4317
  durSec = (_marker_durationSeconds = marker.durationSeconds) !== null && _marker_durationSeconds !== void 0 ? _marker_durationSeconds : 60;
4318
- estimatedCount = Math.min(4, Math.max(1, Math.ceil(durSec / 30)));
4318
+ estimatedCount = Math.min(4, Math.max(1, Math.ceil(durSec / 20)));
4319
4319
  if (this.config.debugAdTiming) {
4320
4320
  console.log("[PREFETCH] Firing ".concat(estimatedCount, " parallel bid request(s) for ").concat(durSec, "s break"));
4321
4321
  }
@@ -4487,6 +4487,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4487
4487
  if (bids.length > 0) {
4488
4488
  _this.consecutiveFailures = 0;
4489
4489
  _this.pendingNextAdBids = bids;
4490
+ _this.totalAdsInBreak = Math.max(_this.totalAdsInBreak, _this.currentAdIndex + _this.preloadedTokens.length + 1);
4490
4491
  if (_this.config.debugAdTiming) {
4491
4492
  console.log("[CONTINUOUS-FETCH] Pre-fetched next ad stored as pending");
4492
4493
  }
@@ -4626,6 +4627,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4626
4627
  17
4627
4628
  ];
4628
4629
  _this.pendingNextAdBids = bids2;
4630
+ _this.totalAdsInBreak = Math.max(_this.totalAdsInBreak, _this.currentAdIndex + _this.preloadedTokens.length + 1);
4629
4631
  if (_this.config.debugAdTiming) {
4630
4632
  console.log("[CONTINUOUS-FETCH] Next ad response stored (ad currently playing or in transition)");
4631
4633
  }
@@ -4779,7 +4781,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4779
4781
  this.inAdBreak = true;
4780
4782
  this.currentAdBreakStartWallClockMs = Date.now();
4781
4783
  this.currentAdIndex = 0;
4782
- this.totalAdsInBreak = 1;
4784
+ this.totalAdsInBreak = Math.max(1, this.preloadedTokens.length);
4783
4785
  this.adPodQueue = [];
4784
4786
  if (!this.config.disableFiller) this.showAds = true;
4785
4787
  if (adBreakDurationMs != null) {
@@ -5004,6 +5006,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5004
5006
  3
5005
5007
  ];
5006
5008
  this.pendingNextAdBids = bids;
5009
+ this.totalAdsInBreak = Math.max(this.totalAdsInBreak, this.currentAdIndex + this.preloadedTokens.length);
5007
5010
  return [
5008
5011
  3,
5009
5012
  5