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
|
@@ -4803,6 +4803,7 @@ var AdConfigManager = /*#__PURE__*/ function() {
|
|
|
4803
4803
|
this.vmapBreaks = [];
|
|
4804
4804
|
this.consumedVmapBreakIds = /* @__PURE__ */ new Set();
|
|
4805
4805
|
this.streamCorrelator = generateCorrelator();
|
|
4806
|
+
this.viewCorrelator = generateCorrelator();
|
|
4806
4807
|
this.consentSignals = {};
|
|
4807
4808
|
this.podCounter = 0;
|
|
4808
4809
|
this.podAssignedByPrefetch = false;
|
|
@@ -5238,7 +5239,7 @@ var AdConfigManager = /*#__PURE__*/ function() {
|
|
|
5238
5239
|
var adWillPlayMuted = inAdBreak ? adPlayer.getOriginalMutedState() : this.video.muted;
|
|
5239
5240
|
var envSignals = resolveVastEnvironmentSignals(!!this.config.ctvAdRequest);
|
|
5240
5241
|
var urlWithMacros = applyVastMacros(baseUrl, {
|
|
5241
|
-
correlator:
|
|
5242
|
+
correlator: this.viewCorrelator,
|
|
5242
5243
|
streamCorrelator: this.streamCorrelator,
|
|
5243
5244
|
pod: this.podCounter > 0 ? this.podCounter : void 0,
|
|
5244
5245
|
adPosition: this.adRequestPositionInBreak,
|
|
@@ -5284,7 +5285,7 @@ var AdConfigManager = /*#__PURE__*/ function() {
|
|
|
5284
5285
|
var adWillPlayMuted = inAdBreak ? adPlayer.getOriginalMutedState() : this.video.muted;
|
|
5285
5286
|
var envSignals = resolveVastEnvironmentSignals(!!this.config.ctvAdRequest);
|
|
5286
5287
|
var urlWithMacros = applyVastMacros(baseUrl, {
|
|
5287
|
-
correlator:
|
|
5288
|
+
correlator: this.viewCorrelator,
|
|
5288
5289
|
streamCorrelator: this.streamCorrelator,
|
|
5289
5290
|
pod: this.podCounter > 0 ? this.podCounter : void 0,
|
|
5290
5291
|
podMaxAds: podParams.maxAds,
|
|
@@ -7135,7 +7136,18 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
|
|
|
7135
7136
|
// IMA event listeners
|
|
7136
7137
|
// ───────────────────────────────────────────────────────────────
|
|
7137
7138
|
function get() {
|
|
7138
|
-
return
|
|
7139
|
+
return this.host.config.optimizedPods !== false;
|
|
7140
|
+
}
|
|
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];
|
|
7139
7151
|
}
|
|
7140
7152
|
},
|
|
7141
7153
|
{
|
|
@@ -7307,7 +7319,7 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
|
|
|
7307
7319
|
// ───────────────────────────────────────────────────────────────
|
|
7308
7320
|
function handleAdStart(_marker) {
|
|
7309
7321
|
return _async_to_generator(function() {
|
|
7310
|
-
var scheduled, tags, baseVastUrl, adBreakDurationMs, mode, currentMuted, currentVolume, podPlayed, firstAdUrl, usePreloadedAd, preloadedController, preloaded,
|
|
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;
|
|
7311
7323
|
return _ts_generator(this, function(_state) {
|
|
7312
7324
|
switch(_state.label){
|
|
7313
7325
|
case 0:
|
|
@@ -7399,8 +7411,7 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
|
|
|
7399
7411
|
if (this.debug) {
|
|
7400
7412
|
console.log("[CONTINUOUS-FETCH] Generating new ad URLs...");
|
|
7401
7413
|
}
|
|
7402
|
-
|
|
7403
|
-
firstAdUrl = firstAdUrlArray[0];
|
|
7414
|
+
firstAdUrl = this.nextAdRequestUrl(baseVastUrl);
|
|
7404
7415
|
this.adRequestQueue = [];
|
|
7405
7416
|
}
|
|
7406
7417
|
if (!firstAdUrl) {
|
|
@@ -7457,11 +7468,13 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
|
|
|
7457
7468
|
preloadedController.resume();
|
|
7458
7469
|
this.timing.consecutiveFailures = 0;
|
|
7459
7470
|
this.startContinuousFetching(baseVastUrl);
|
|
7460
|
-
if (!this.
|
|
7461
|
-
this.preloadPool.active
|
|
7462
|
-
|
|
7463
|
-
|
|
7464
|
-
this.preloadPool.
|
|
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
|
+
}
|
|
7465
7478
|
}
|
|
7466
7479
|
return [
|
|
7467
7480
|
4,
|
|
@@ -7521,7 +7534,7 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
|
|
|
7521
7534
|
case 11:
|
|
7522
7535
|
this.timing.consecutiveFailures = 0;
|
|
7523
7536
|
this.startContinuousFetching(baseVastUrl);
|
|
7524
|
-
if (!this.preloadPool.active) {
|
|
7537
|
+
if (!this.optimizedPodsEnabled && !this.preloadPool.active) {
|
|
7525
7538
|
this.preloadPool.startPreloadPool(baseVastUrl, []);
|
|
7526
7539
|
}
|
|
7527
7540
|
return [
|
|
@@ -7586,7 +7599,7 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
|
|
|
7586
7599
|
this.swapToPreloadedAdPlayer(fallbackPreloaded.adController);
|
|
7587
7600
|
this.timing.consecutiveFailures = 0;
|
|
7588
7601
|
this.startContinuousFetching(baseVastUrl);
|
|
7589
|
-
if (!this.preloadPool.active) {
|
|
7602
|
+
if (!this.optimizedPodsEnabled && !this.preloadPool.active) {
|
|
7590
7603
|
this.preloadPool.active = true;
|
|
7591
7604
|
this.preloadPool.preloadPoolLoop(baseVastUrl);
|
|
7592
7605
|
}
|
|
@@ -7736,9 +7749,6 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
|
|
|
7736
7749
|
if (podCount === 1) {
|
|
7737
7750
|
this.continuousFetchingActive = true;
|
|
7738
7751
|
this.startContinuousFetching(baseVastUrl);
|
|
7739
|
-
if (!this.preloadPool.active) {
|
|
7740
|
-
this.preloadPool.startPreloadPool(baseVastUrl, []);
|
|
7741
|
-
}
|
|
7742
7752
|
}
|
|
7743
7753
|
return [
|
|
7744
7754
|
2,
|
|
@@ -7879,7 +7889,7 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
|
|
|
7879
7889
|
"continue"
|
|
7880
7890
|
];
|
|
7881
7891
|
case 2:
|
|
7882
|
-
newAdUrl = _this.
|
|
7892
|
+
newAdUrl = _this.nextAdRequestUrl(baseVastUrl);
|
|
7883
7893
|
if (!(!newAdUrl || _this.timing.failedVastUrls.has(newAdUrl) || _this.timing.isUrlInCooldown(newAdUrl))) return [
|
|
7884
7894
|
3,
|
|
7885
7895
|
4
|
|
@@ -9275,7 +9285,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
9275
9285
|
}
|
|
9276
9286
|
this.adConfig.beginNewAdPod();
|
|
9277
9287
|
this.adConfig.podAssignedByPrefetch = true;
|
|
9278
|
-
var optimizedPods =
|
|
9288
|
+
var optimizedPods = this.config.optimizedPods !== false;
|
|
9279
9289
|
var breakDurationMs = marker.durationSeconds != null ? marker.durationSeconds * 1e3 : void 0;
|
|
9280
9290
|
var generatedUrls = optimizedPods ? [
|
|
9281
9291
|
this.generatePodVastUrl(baseVastUrl, breakDurationMs)
|