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
|
@@ -8,6 +8,7 @@ declare class AdConfigManager {
|
|
|
8
8
|
apiVastTagUrl: string | undefined;
|
|
9
9
|
apiNumberAds: number | undefined;
|
|
10
10
|
readonly streamCorrelator: string;
|
|
11
|
+
readonly viewCorrelator: string;
|
|
11
12
|
consentSignals: VastConsentSignals;
|
|
12
13
|
podCounter: number;
|
|
13
14
|
podAssignedByPrefetch: boolean;
|
|
@@ -4766,6 +4766,7 @@ var AdConfigManager = /*#__PURE__*/ function() {
|
|
|
4766
4766
|
this.vmapBreaks = [];
|
|
4767
4767
|
this.consumedVmapBreakIds = /* @__PURE__ */ new Set();
|
|
4768
4768
|
this.streamCorrelator = generateCorrelator();
|
|
4769
|
+
this.viewCorrelator = generateCorrelator();
|
|
4769
4770
|
this.consentSignals = {};
|
|
4770
4771
|
this.podCounter = 0;
|
|
4771
4772
|
this.podAssignedByPrefetch = false;
|
|
@@ -5201,7 +5202,7 @@ var AdConfigManager = /*#__PURE__*/ function() {
|
|
|
5201
5202
|
var adWillPlayMuted = inAdBreak ? adPlayer.getOriginalMutedState() : this.video.muted;
|
|
5202
5203
|
var envSignals = resolveVastEnvironmentSignals(!!this.config.ctvAdRequest);
|
|
5203
5204
|
var urlWithMacros = applyVastMacros(baseUrl, {
|
|
5204
|
-
correlator:
|
|
5205
|
+
correlator: this.viewCorrelator,
|
|
5205
5206
|
streamCorrelator: this.streamCorrelator,
|
|
5206
5207
|
pod: this.podCounter > 0 ? this.podCounter : void 0,
|
|
5207
5208
|
adPosition: this.adRequestPositionInBreak,
|
|
@@ -5247,7 +5248,7 @@ var AdConfigManager = /*#__PURE__*/ function() {
|
|
|
5247
5248
|
var adWillPlayMuted = inAdBreak ? adPlayer.getOriginalMutedState() : this.video.muted;
|
|
5248
5249
|
var envSignals = resolveVastEnvironmentSignals(!!this.config.ctvAdRequest);
|
|
5249
5250
|
var urlWithMacros = applyVastMacros(baseUrl, {
|
|
5250
|
-
correlator:
|
|
5251
|
+
correlator: this.viewCorrelator,
|
|
5251
5252
|
streamCorrelator: this.streamCorrelator,
|
|
5252
5253
|
pod: this.podCounter > 0 ? this.podCounter : void 0,
|
|
5253
5254
|
podMaxAds: podParams.maxAds,
|
|
@@ -7098,7 +7099,18 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
|
|
|
7098
7099
|
// IMA event listeners
|
|
7099
7100
|
// ───────────────────────────────────────────────────────────────
|
|
7100
7101
|
function get() {
|
|
7101
|
-
return
|
|
7102
|
+
return this.host.config.optimizedPods !== false;
|
|
7103
|
+
}
|
|
7104
|
+
},
|
|
7105
|
+
{
|
|
7106
|
+
key: "nextAdRequestUrl",
|
|
7107
|
+
value: function nextAdRequestUrl(baseVastUrl) {
|
|
7108
|
+
if (this.optimizedPodsEnabled) {
|
|
7109
|
+
var remaining = Math.min(this.timing.getWallClockRemainingAdMs(), this.timing.getDurationBudgetRemainingMs());
|
|
7110
|
+
var breakDurationMs = remaining > 0 ? remaining : void 0;
|
|
7111
|
+
return this.host.generatePodVastUrl(baseVastUrl, breakDurationMs);
|
|
7112
|
+
}
|
|
7113
|
+
return this.host.generateVastUrls(baseVastUrl, 1)[0];
|
|
7102
7114
|
}
|
|
7103
7115
|
},
|
|
7104
7116
|
{
|
|
@@ -7270,7 +7282,7 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
|
|
|
7270
7282
|
// ───────────────────────────────────────────────────────────────
|
|
7271
7283
|
function handleAdStart(_marker) {
|
|
7272
7284
|
return _async_to_generator(function() {
|
|
7273
|
-
var scheduled, tags, baseVastUrl, adBreakDurationMs, mode, currentMuted, currentVolume, podPlayed, firstAdUrl, usePreloadedAd, preloadedController, preloaded,
|
|
7285
|
+
var scheduled, tags, baseVastUrl, adBreakDurationMs, mode, currentMuted, currentVolume, podPlayed, firstAdUrl, usePreloadedAd, preloadedController, preloaded, adPlayer, preservedMuted, preservedVolume, adVolume, adPlayer1, adVolume1, error, fallbackPreloaded, ap, adVolume2, fallbackError;
|
|
7274
7286
|
return _ts_generator(this, function(_state) {
|
|
7275
7287
|
switch(_state.label){
|
|
7276
7288
|
case 0:
|
|
@@ -7362,8 +7374,7 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
|
|
|
7362
7374
|
if (this.debug) {
|
|
7363
7375
|
console.log("[CONTINUOUS-FETCH] Generating new ad URLs...");
|
|
7364
7376
|
}
|
|
7365
|
-
|
|
7366
|
-
firstAdUrl = firstAdUrlArray[0];
|
|
7377
|
+
firstAdUrl = this.nextAdRequestUrl(baseVastUrl);
|
|
7367
7378
|
this.adRequestQueue = [];
|
|
7368
7379
|
}
|
|
7369
7380
|
if (!firstAdUrl) {
|
|
@@ -7420,11 +7431,13 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
|
|
|
7420
7431
|
preloadedController.resume();
|
|
7421
7432
|
this.timing.consecutiveFailures = 0;
|
|
7422
7433
|
this.startContinuousFetching(baseVastUrl);
|
|
7423
|
-
if (!this.
|
|
7424
|
-
this.preloadPool.active
|
|
7425
|
-
|
|
7426
|
-
|
|
7427
|
-
this.preloadPool.
|
|
7434
|
+
if (!this.optimizedPodsEnabled) {
|
|
7435
|
+
if (!this.preloadPool.active) {
|
|
7436
|
+
this.preloadPool.active = true;
|
|
7437
|
+
}
|
|
7438
|
+
if (!this.preloadPool.isLoopRunning) {
|
|
7439
|
+
this.preloadPool.preloadPoolLoop(baseVastUrl);
|
|
7440
|
+
}
|
|
7428
7441
|
}
|
|
7429
7442
|
return [
|
|
7430
7443
|
4,
|
|
@@ -7484,7 +7497,7 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
|
|
|
7484
7497
|
case 11:
|
|
7485
7498
|
this.timing.consecutiveFailures = 0;
|
|
7486
7499
|
this.startContinuousFetching(baseVastUrl);
|
|
7487
|
-
if (!this.preloadPool.active) {
|
|
7500
|
+
if (!this.optimizedPodsEnabled && !this.preloadPool.active) {
|
|
7488
7501
|
this.preloadPool.startPreloadPool(baseVastUrl, []);
|
|
7489
7502
|
}
|
|
7490
7503
|
return [
|
|
@@ -7549,7 +7562,7 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
|
|
|
7549
7562
|
this.swapToPreloadedAdPlayer(fallbackPreloaded.adController);
|
|
7550
7563
|
this.timing.consecutiveFailures = 0;
|
|
7551
7564
|
this.startContinuousFetching(baseVastUrl);
|
|
7552
|
-
if (!this.preloadPool.active) {
|
|
7565
|
+
if (!this.optimizedPodsEnabled && !this.preloadPool.active) {
|
|
7553
7566
|
this.preloadPool.active = true;
|
|
7554
7567
|
this.preloadPool.preloadPoolLoop(baseVastUrl);
|
|
7555
7568
|
}
|
|
@@ -7699,9 +7712,6 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
|
|
|
7699
7712
|
if (podCount === 1) {
|
|
7700
7713
|
this.continuousFetchingActive = true;
|
|
7701
7714
|
this.startContinuousFetching(baseVastUrl);
|
|
7702
|
-
if (!this.preloadPool.active) {
|
|
7703
|
-
this.preloadPool.startPreloadPool(baseVastUrl, []);
|
|
7704
|
-
}
|
|
7705
7715
|
}
|
|
7706
7716
|
return [
|
|
7707
7717
|
2,
|
|
@@ -7842,7 +7852,7 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
|
|
|
7842
7852
|
"continue"
|
|
7843
7853
|
];
|
|
7844
7854
|
case 2:
|
|
7845
|
-
newAdUrl = _this.
|
|
7855
|
+
newAdUrl = _this.nextAdRequestUrl(baseVastUrl);
|
|
7846
7856
|
if (!(!newAdUrl || _this.timing.failedVastUrls.has(newAdUrl) || _this.timing.isUrlInCooldown(newAdUrl))) return [
|
|
7847
7857
|
3,
|
|
7848
7858
|
4
|
|
@@ -9238,7 +9248,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
9238
9248
|
}
|
|
9239
9249
|
this.adConfig.beginNewAdPod();
|
|
9240
9250
|
this.adConfig.podAssignedByPrefetch = true;
|
|
9241
|
-
var optimizedPods =
|
|
9251
|
+
var optimizedPods = this.config.optimizedPods !== false;
|
|
9242
9252
|
var breakDurationMs = marker.durationSeconds != null ? marker.durationSeconds * 1e3 : void 0;
|
|
9243
9253
|
var generatedUrls = optimizedPods ? [
|
|
9244
9254
|
this.generatePodVastUrl(baseVastUrl, breakDurationMs)
|