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
package/lib/players/index.cjs
CHANGED
|
@@ -4853,6 +4853,7 @@ var AdConfigManager = /*#__PURE__*/ function() {
|
|
|
4853
4853
|
this.vmapBreaks = [];
|
|
4854
4854
|
this.consumedVmapBreakIds = /* @__PURE__ */ new Set();
|
|
4855
4855
|
this.streamCorrelator = generateCorrelator();
|
|
4856
|
+
this.viewCorrelator = generateCorrelator();
|
|
4856
4857
|
this.consentSignals = {};
|
|
4857
4858
|
this.podCounter = 0;
|
|
4858
4859
|
this.podAssignedByPrefetch = false;
|
|
@@ -5288,7 +5289,7 @@ var AdConfigManager = /*#__PURE__*/ function() {
|
|
|
5288
5289
|
var adWillPlayMuted = inAdBreak ? adPlayer.getOriginalMutedState() : this.video.muted;
|
|
5289
5290
|
var envSignals = resolveVastEnvironmentSignals(!!this.config.ctvAdRequest);
|
|
5290
5291
|
var urlWithMacros = applyVastMacros(baseUrl, {
|
|
5291
|
-
correlator:
|
|
5292
|
+
correlator: this.viewCorrelator,
|
|
5292
5293
|
streamCorrelator: this.streamCorrelator,
|
|
5293
5294
|
pod: this.podCounter > 0 ? this.podCounter : void 0,
|
|
5294
5295
|
adPosition: this.adRequestPositionInBreak,
|
|
@@ -5334,7 +5335,7 @@ var AdConfigManager = /*#__PURE__*/ function() {
|
|
|
5334
5335
|
var adWillPlayMuted = inAdBreak ? adPlayer.getOriginalMutedState() : this.video.muted;
|
|
5335
5336
|
var envSignals = resolveVastEnvironmentSignals(!!this.config.ctvAdRequest);
|
|
5336
5337
|
var urlWithMacros = applyVastMacros(baseUrl, {
|
|
5337
|
-
correlator:
|
|
5338
|
+
correlator: this.viewCorrelator,
|
|
5338
5339
|
streamCorrelator: this.streamCorrelator,
|
|
5339
5340
|
pod: this.podCounter > 0 ? this.podCounter : void 0,
|
|
5340
5341
|
podMaxAds: podParams.maxAds,
|
|
@@ -7185,7 +7186,18 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
|
|
|
7185
7186
|
// IMA event listeners
|
|
7186
7187
|
// ───────────────────────────────────────────────────────────────
|
|
7187
7188
|
function get() {
|
|
7188
|
-
return
|
|
7189
|
+
return this.host.config.optimizedPods !== false;
|
|
7190
|
+
}
|
|
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];
|
|
7189
7201
|
}
|
|
7190
7202
|
},
|
|
7191
7203
|
{
|
|
@@ -7357,7 +7369,7 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
|
|
|
7357
7369
|
// ───────────────────────────────────────────────────────────────
|
|
7358
7370
|
function handleAdStart(_marker) {
|
|
7359
7371
|
return _async_to_generator(function() {
|
|
7360
|
-
var scheduled, tags, baseVastUrl, adBreakDurationMs, mode, currentMuted, currentVolume, podPlayed, firstAdUrl, usePreloadedAd, preloadedController, preloaded,
|
|
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;
|
|
7361
7373
|
return _ts_generator(this, function(_state) {
|
|
7362
7374
|
switch(_state.label){
|
|
7363
7375
|
case 0:
|
|
@@ -7449,8 +7461,7 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
|
|
|
7449
7461
|
if (this.debug) {
|
|
7450
7462
|
console.log("[CONTINUOUS-FETCH] Generating new ad URLs...");
|
|
7451
7463
|
}
|
|
7452
|
-
|
|
7453
|
-
firstAdUrl = firstAdUrlArray[0];
|
|
7464
|
+
firstAdUrl = this.nextAdRequestUrl(baseVastUrl);
|
|
7454
7465
|
this.adRequestQueue = [];
|
|
7455
7466
|
}
|
|
7456
7467
|
if (!firstAdUrl) {
|
|
@@ -7507,11 +7518,13 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
|
|
|
7507
7518
|
preloadedController.resume();
|
|
7508
7519
|
this.timing.consecutiveFailures = 0;
|
|
7509
7520
|
this.startContinuousFetching(baseVastUrl);
|
|
7510
|
-
if (!this.
|
|
7511
|
-
this.preloadPool.active
|
|
7512
|
-
|
|
7513
|
-
|
|
7514
|
-
this.preloadPool.
|
|
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
|
+
}
|
|
7515
7528
|
}
|
|
7516
7529
|
return [
|
|
7517
7530
|
4,
|
|
@@ -7571,7 +7584,7 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
|
|
|
7571
7584
|
case 11:
|
|
7572
7585
|
this.timing.consecutiveFailures = 0;
|
|
7573
7586
|
this.startContinuousFetching(baseVastUrl);
|
|
7574
|
-
if (!this.preloadPool.active) {
|
|
7587
|
+
if (!this.optimizedPodsEnabled && !this.preloadPool.active) {
|
|
7575
7588
|
this.preloadPool.startPreloadPool(baseVastUrl, []);
|
|
7576
7589
|
}
|
|
7577
7590
|
return [
|
|
@@ -7636,7 +7649,7 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
|
|
|
7636
7649
|
this.swapToPreloadedAdPlayer(fallbackPreloaded.adController);
|
|
7637
7650
|
this.timing.consecutiveFailures = 0;
|
|
7638
7651
|
this.startContinuousFetching(baseVastUrl);
|
|
7639
|
-
if (!this.preloadPool.active) {
|
|
7652
|
+
if (!this.optimizedPodsEnabled && !this.preloadPool.active) {
|
|
7640
7653
|
this.preloadPool.active = true;
|
|
7641
7654
|
this.preloadPool.preloadPoolLoop(baseVastUrl);
|
|
7642
7655
|
}
|
|
@@ -7786,9 +7799,6 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
|
|
|
7786
7799
|
if (podCount === 1) {
|
|
7787
7800
|
this.continuousFetchingActive = true;
|
|
7788
7801
|
this.startContinuousFetching(baseVastUrl);
|
|
7789
|
-
if (!this.preloadPool.active) {
|
|
7790
|
-
this.preloadPool.startPreloadPool(baseVastUrl, []);
|
|
7791
|
-
}
|
|
7792
7802
|
}
|
|
7793
7803
|
return [
|
|
7794
7804
|
2,
|
|
@@ -7929,7 +7939,7 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
|
|
|
7929
7939
|
"continue"
|
|
7930
7940
|
];
|
|
7931
7941
|
case 2:
|
|
7932
|
-
newAdUrl = _this.
|
|
7942
|
+
newAdUrl = _this.nextAdRequestUrl(baseVastUrl);
|
|
7933
7943
|
if (!(!newAdUrl || _this.timing.failedVastUrls.has(newAdUrl) || _this.timing.isUrlInCooldown(newAdUrl))) return [
|
|
7934
7944
|
3,
|
|
7935
7945
|
4
|
|
@@ -9325,7 +9335,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
9325
9335
|
}
|
|
9326
9336
|
this.adConfig.beginNewAdPod();
|
|
9327
9337
|
this.adConfig.podAssignedByPrefetch = true;
|
|
9328
|
-
var optimizedPods =
|
|
9338
|
+
var optimizedPods = this.config.optimizedPods !== false;
|
|
9329
9339
|
var breakDurationMs = marker.durationSeconds != null ? marker.durationSeconds * 1e3 : void 0;
|
|
9330
9340
|
var generatedUrls = optimizedPods ? [
|
|
9331
9341
|
this.generatePodVastUrl(baseVastUrl, breakDurationMs)
|