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.
- package/dist/stormcloud-vp.min.js +1 -1
- package/lib/index.cjs +28 -18
- package/lib/index.cjs.map +1 -1
- package/lib/index.js +28 -18
- package/lib/index.js.map +1 -1
- package/lib/player/AdBreakOrchestrator.cjs +24 -15
- package/lib/player/AdBreakOrchestrator.cjs.map +1 -1
- package/lib/player/AdBreakOrchestrator.d.cts +1 -0
- package/lib/player/AdConfigManager.cjs +3 -2
- package/lib/player/AdConfigManager.cjs.map +1 -1
- package/lib/player/AdConfigManager.d.cts +1 -0
- package/lib/player/StormcloudVideoPlayer.cjs +28 -18
- package/lib/player/StormcloudVideoPlayer.cjs.map +1 -1
- package/lib/players/HlsPlayer.cjs +28 -18
- package/lib/players/HlsPlayer.cjs.map +1 -1
- package/lib/players/index.cjs +28 -18
- package/lib/players/index.cjs.map +1 -1
- package/lib/ui/StormcloudVideoPlayer.cjs +28 -18
- package/lib/ui/StormcloudVideoPlayer.cjs.map +1 -1
- package/package.json +1 -1
|
@@ -4817,6 +4817,7 @@ var AdConfigManager = /*#__PURE__*/ function() {
|
|
|
4817
4817
|
this.vmapBreaks = [];
|
|
4818
4818
|
this.consumedVmapBreakIds = /* @__PURE__ */ new Set();
|
|
4819
4819
|
this.streamCorrelator = generateCorrelator();
|
|
4820
|
+
this.viewCorrelator = generateCorrelator();
|
|
4820
4821
|
this.consentSignals = {};
|
|
4821
4822
|
this.podCounter = 0;
|
|
4822
4823
|
this.podAssignedByPrefetch = false;
|
|
@@ -5252,7 +5253,7 @@ var AdConfigManager = /*#__PURE__*/ function() {
|
|
|
5252
5253
|
var adWillPlayMuted = inAdBreak ? adPlayer.getOriginalMutedState() : this.video.muted;
|
|
5253
5254
|
var envSignals = resolveVastEnvironmentSignals(!!this.config.ctvAdRequest);
|
|
5254
5255
|
var urlWithMacros = applyVastMacros(baseUrl, {
|
|
5255
|
-
correlator:
|
|
5256
|
+
correlator: this.viewCorrelator,
|
|
5256
5257
|
streamCorrelator: this.streamCorrelator,
|
|
5257
5258
|
pod: this.podCounter > 0 ? this.podCounter : void 0,
|
|
5258
5259
|
adPosition: this.adRequestPositionInBreak,
|
|
@@ -5298,7 +5299,7 @@ var AdConfigManager = /*#__PURE__*/ function() {
|
|
|
5298
5299
|
var adWillPlayMuted = inAdBreak ? adPlayer.getOriginalMutedState() : this.video.muted;
|
|
5299
5300
|
var envSignals = resolveVastEnvironmentSignals(!!this.config.ctvAdRequest);
|
|
5300
5301
|
var urlWithMacros = applyVastMacros(baseUrl, {
|
|
5301
|
-
correlator:
|
|
5302
|
+
correlator: this.viewCorrelator,
|
|
5302
5303
|
streamCorrelator: this.streamCorrelator,
|
|
5303
5304
|
pod: this.podCounter > 0 ? this.podCounter : void 0,
|
|
5304
5305
|
podMaxAds: podParams.maxAds,
|
|
@@ -7149,7 +7150,18 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
|
|
|
7149
7150
|
// IMA event listeners
|
|
7150
7151
|
// ───────────────────────────────────────────────────────────────
|
|
7151
7152
|
function get() {
|
|
7152
|
-
return
|
|
7153
|
+
return this.host.config.optimizedPods !== false;
|
|
7154
|
+
}
|
|
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];
|
|
7153
7165
|
}
|
|
7154
7166
|
},
|
|
7155
7167
|
{
|
|
@@ -7321,7 +7333,7 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
|
|
|
7321
7333
|
// ───────────────────────────────────────────────────────────────
|
|
7322
7334
|
function handleAdStart(_marker) {
|
|
7323
7335
|
return _async_to_generator(function() {
|
|
7324
|
-
var scheduled, tags, baseVastUrl, adBreakDurationMs, mode, currentMuted, currentVolume, podPlayed, firstAdUrl, usePreloadedAd, preloadedController, preloaded,
|
|
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;
|
|
7325
7337
|
return _ts_generator(this, function(_state) {
|
|
7326
7338
|
switch(_state.label){
|
|
7327
7339
|
case 0:
|
|
@@ -7413,8 +7425,7 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
|
|
|
7413
7425
|
if (this.debug) {
|
|
7414
7426
|
console.log("[CONTINUOUS-FETCH] Generating new ad URLs...");
|
|
7415
7427
|
}
|
|
7416
|
-
|
|
7417
|
-
firstAdUrl = firstAdUrlArray[0];
|
|
7428
|
+
firstAdUrl = this.nextAdRequestUrl(baseVastUrl);
|
|
7418
7429
|
this.adRequestQueue = [];
|
|
7419
7430
|
}
|
|
7420
7431
|
if (!firstAdUrl) {
|
|
@@ -7471,11 +7482,13 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
|
|
|
7471
7482
|
preloadedController.resume();
|
|
7472
7483
|
this.timing.consecutiveFailures = 0;
|
|
7473
7484
|
this.startContinuousFetching(baseVastUrl);
|
|
7474
|
-
if (!this.
|
|
7475
|
-
this.preloadPool.active
|
|
7476
|
-
|
|
7477
|
-
|
|
7478
|
-
this.preloadPool.
|
|
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
|
+
}
|
|
7479
7492
|
}
|
|
7480
7493
|
return [
|
|
7481
7494
|
4,
|
|
@@ -7535,7 +7548,7 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
|
|
|
7535
7548
|
case 11:
|
|
7536
7549
|
this.timing.consecutiveFailures = 0;
|
|
7537
7550
|
this.startContinuousFetching(baseVastUrl);
|
|
7538
|
-
if (!this.preloadPool.active) {
|
|
7551
|
+
if (!this.optimizedPodsEnabled && !this.preloadPool.active) {
|
|
7539
7552
|
this.preloadPool.startPreloadPool(baseVastUrl, []);
|
|
7540
7553
|
}
|
|
7541
7554
|
return [
|
|
@@ -7600,7 +7613,7 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
|
|
|
7600
7613
|
this.swapToPreloadedAdPlayer(fallbackPreloaded.adController);
|
|
7601
7614
|
this.timing.consecutiveFailures = 0;
|
|
7602
7615
|
this.startContinuousFetching(baseVastUrl);
|
|
7603
|
-
if (!this.preloadPool.active) {
|
|
7616
|
+
if (!this.optimizedPodsEnabled && !this.preloadPool.active) {
|
|
7604
7617
|
this.preloadPool.active = true;
|
|
7605
7618
|
this.preloadPool.preloadPoolLoop(baseVastUrl);
|
|
7606
7619
|
}
|
|
@@ -7750,9 +7763,6 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
|
|
|
7750
7763
|
if (podCount === 1) {
|
|
7751
7764
|
this.continuousFetchingActive = true;
|
|
7752
7765
|
this.startContinuousFetching(baseVastUrl);
|
|
7753
|
-
if (!this.preloadPool.active) {
|
|
7754
|
-
this.preloadPool.startPreloadPool(baseVastUrl, []);
|
|
7755
|
-
}
|
|
7756
7766
|
}
|
|
7757
7767
|
return [
|
|
7758
7768
|
2,
|
|
@@ -7893,7 +7903,7 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
|
|
|
7893
7903
|
"continue"
|
|
7894
7904
|
];
|
|
7895
7905
|
case 2:
|
|
7896
|
-
newAdUrl = _this.
|
|
7906
|
+
newAdUrl = _this.nextAdRequestUrl(baseVastUrl);
|
|
7897
7907
|
if (!(!newAdUrl || _this.timing.failedVastUrls.has(newAdUrl) || _this.timing.isUrlInCooldown(newAdUrl))) return [
|
|
7898
7908
|
3,
|
|
7899
7909
|
4
|
|
@@ -9289,7 +9299,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
9289
9299
|
}
|
|
9290
9300
|
this.adConfig.beginNewAdPod();
|
|
9291
9301
|
this.adConfig.podAssignedByPrefetch = true;
|
|
9292
|
-
var optimizedPods =
|
|
9302
|
+
var optimizedPods = this.config.optimizedPods !== false;
|
|
9293
9303
|
var breakDurationMs = marker.durationSeconds != null ? marker.durationSeconds * 1e3 : void 0;
|
|
9294
9304
|
var generatedUrls = optimizedPods ? [
|
|
9295
9305
|
this.generatePodVastUrl(baseVastUrl, breakDurationMs)
|