stormcloud-video-player 0.8.28 → 0.8.30
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 +2 -2
- package/lib/index.cjs +80 -1038
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +0 -3
- package/lib/index.d.ts +0 -3
- package/lib/index.js +80 -1039
- package/lib/index.js.map +1 -1
- package/lib/player/AdBreakOrchestrator.cjs +59 -483
- package/lib/player/AdBreakOrchestrator.cjs.map +1 -1
- package/lib/player/AdBreakOrchestrator.d.cts +9 -7
- package/lib/player/AdConfigManager.cjs +12 -53
- package/lib/player/AdConfigManager.cjs.map +1 -1
- package/lib/player/AdConfigManager.d.cts +4 -5
- package/lib/player/AdTimingService.d.cts +1 -1
- package/lib/player/HlsEngine.d.cts +1 -1
- package/lib/player/PlayerControls.d.cts +1 -1
- package/lib/player/Scte35CueManager.d.cts +1 -1
- package/lib/player/Scte35Parser.d.cts +1 -1
- package/lib/player/StormcloudVideoPlayer.cjs +80 -1038
- package/lib/player/StormcloudVideoPlayer.cjs.map +1 -1
- package/lib/player/StormcloudVideoPlayer.d.cts +1 -3
- package/lib/player/playerTypes.d.cts +1 -1
- package/lib/players/HlsPlayer.cjs +80 -1038
- package/lib/players/HlsPlayer.cjs.map +1 -1
- package/lib/players/HlsPlayer.d.cts +1 -1
- package/lib/players/index.cjs +80 -1038
- package/lib/players/index.cjs.map +1 -1
- package/lib/sdk/hlsAdPlayer.d.cts +1 -1
- package/lib/{types-Xgz2_W1C.d.cts → types-CSHvCbhZ.d.cts} +0 -1
- package/lib/ui/StormcloudVideoPlayer.cjs +80 -1038
- package/lib/ui/StormcloudVideoPlayer.cjs.map +1 -1
- package/lib/ui/StormcloudVideoPlayer.d.cts +1 -1
- package/lib/utils/tracking.d.cts +1 -1
- package/lib/utils/vastMacros.cjs +10 -15
- package/lib/utils/vastMacros.cjs.map +1 -1
- package/lib/utils/vastMacros.d.cts +0 -1
- package/package.json +1 -1
- package/lib/player/AdPreloadPool.cjs +0 -673
- package/lib/player/AdPreloadPool.cjs.map +0 -1
- package/lib/player/AdPreloadPool.d.cts +0 -37
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { S as Scte35Marker, a as StormcloudVideoPlayerConfig, A as AdController } from '../types-
|
|
1
|
+
import { S as Scte35Marker, a as StormcloudVideoPlayerConfig, A as AdController } from '../types-CSHvCbhZ.cjs';
|
|
2
2
|
import { AdTimingService } from './AdTimingService.cjs';
|
|
3
|
-
import { AdPreloadPool } from './AdPreloadPool.cjs';
|
|
4
3
|
import { AdConfigManager } from './AdConfigManager.cjs';
|
|
5
4
|
import { Scte35CueManager } from './Scte35CueManager.cjs';
|
|
6
5
|
import { PlaceholderLayer } from './PlaceholderLayer.cjs';
|
|
@@ -16,7 +15,6 @@ interface AdBreakOrchestratorHost {
|
|
|
16
15
|
createAdPlayer(continueLiveStreamDuringAds: boolean): AdController;
|
|
17
16
|
shouldContinueLiveStreamDuringAds(): boolean;
|
|
18
17
|
getLiveSyncPosition(): number | undefined;
|
|
19
|
-
generateVastUrls(baseUrl: string, count: number): string[];
|
|
20
18
|
generatePodVastUrl(baseUrl: string, breakDurationMs?: number): string;
|
|
21
19
|
}
|
|
22
20
|
declare class AdBreakOrchestrator {
|
|
@@ -39,20 +37,24 @@ declare class AdBreakOrchestrator {
|
|
|
39
37
|
prefetchTimerId: number | undefined;
|
|
40
38
|
private readonly host;
|
|
41
39
|
private readonly timing;
|
|
42
|
-
private readonly preloadPool;
|
|
43
40
|
private readonly adConfig;
|
|
44
41
|
private readonly cueManager;
|
|
45
42
|
private readonly placeholder;
|
|
46
|
-
constructor(host: AdBreakOrchestratorHost, timing: AdTimingService,
|
|
43
|
+
constructor(host: AdBreakOrchestratorHost, timing: AdTimingService, adConfig: AdConfigManager, cueManager: Scte35CueManager, placeholder: PlaceholderLayer);
|
|
47
44
|
private get debug();
|
|
48
45
|
private get analyticsContext();
|
|
49
|
-
|
|
46
|
+
/**
|
|
47
|
+
* Produces the next pod ad-request URL for the current break. Every request
|
|
48
|
+
* (initial and continuous-fetch top-up) carries pod macros (pmad/pmnd/pmxd,
|
|
49
|
+
* no ppos); pmxd tracks the remaining break time so top-up pods only ask for
|
|
50
|
+
* what still fits.
|
|
51
|
+
*/
|
|
52
|
+
private nextAdRequestUrl;
|
|
50
53
|
attachImaEventListeners(): void;
|
|
51
54
|
recreateAdController(): void;
|
|
52
55
|
clearPendingAdBreak(): void;
|
|
53
56
|
handleAdStart(_marker: Scte35Marker): Promise<void>;
|
|
54
57
|
private startOptimizedPod;
|
|
55
|
-
private swapToPreloadedAdPlayer;
|
|
56
58
|
private startContinuousFetching;
|
|
57
59
|
private continuousFetchLoop;
|
|
58
60
|
stopContinuousFetching(): void;
|
|
@@ -1155,21 +1155,16 @@ function applyVastMacros(baseUrl, ctx) {
|
|
|
1155
1155
|
if (ctx.pod != null) {
|
|
1156
1156
|
params.set("pod", String(ctx.pod));
|
|
1157
1157
|
}
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
params.
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
if (ctx.podMaxAds != null) {
|
|
1169
|
-
params.set("pmad", String(Math.max(1, Math.round(ctx.podMaxAds))));
|
|
1170
|
-
}
|
|
1171
|
-
} else if (ctx.adPosition != null) {
|
|
1172
|
-
params.set("ppos", String(ctx.adPosition));
|
|
1158
|
+
params.delete("ppos");
|
|
1159
|
+
params.delete("lip");
|
|
1160
|
+
if (ctx.podMinDurationMs != null) {
|
|
1161
|
+
params.set("pmnd", String(Math.max(0, Math.round(ctx.podMinDurationMs))));
|
|
1162
|
+
}
|
|
1163
|
+
if (ctx.podMaxDurationMs != null) {
|
|
1164
|
+
params.set("pmxd", String(Math.max(0, Math.round(ctx.podMaxDurationMs))));
|
|
1165
|
+
}
|
|
1166
|
+
if (ctx.podMaxAds != null) {
|
|
1167
|
+
params.set("pmad", String(Math.max(1, Math.round(ctx.podMaxAds))));
|
|
1173
1168
|
}
|
|
1174
1169
|
var requestUrl = ctx.contentUrl || ctx.pageUrl;
|
|
1175
1170
|
if (requestUrl) {
|
|
@@ -1771,9 +1766,9 @@ var AdConfigManager = /*#__PURE__*/ function() {
|
|
|
1771
1766
|
this.consentSignals = {};
|
|
1772
1767
|
this.podCounter = 0;
|
|
1773
1768
|
this.podAssignedByPrefetch = false;
|
|
1774
|
-
this.adRequestPositionInBreak = 0;
|
|
1775
1769
|
this.lastHeartbeatTime = 0;
|
|
1776
1770
|
this.defaultPodMaxAds = 6;
|
|
1771
|
+
this.defaultPodMaxDurationMs = 12e4;
|
|
1777
1772
|
this.config = config;
|
|
1778
1773
|
this.video = video;
|
|
1779
1774
|
}
|
|
@@ -2191,48 +2186,12 @@ var AdConfigManager = /*#__PURE__*/ function() {
|
|
|
2191
2186
|
key: "beginNewAdPod",
|
|
2192
2187
|
value: function beginNewAdPod() {
|
|
2193
2188
|
this.podCounter++;
|
|
2194
|
-
this.adRequestPositionInBreak = 0;
|
|
2195
|
-
}
|
|
2196
|
-
},
|
|
2197
|
-
{
|
|
2198
|
-
key: "generateVastUrlsWithCorrelators",
|
|
2199
|
-
value: function generateVastUrlsWithCorrelators(baseUrl, count, adPlayer, palNonce, inAdBreak) {
|
|
2200
|
-
var urls = [];
|
|
2201
|
-
for(var i = 0; i < count; i++){
|
|
2202
|
-
this.adRequestPositionInBreak++;
|
|
2203
|
-
var adWillPlayMuted = inAdBreak ? adPlayer.getOriginalMutedState() : this.video.muted;
|
|
2204
|
-
var envSignals = resolveVastEnvironmentSignals(!!this.config.ctvAdRequest);
|
|
2205
|
-
var urlWithMacros = applyVastMacros(baseUrl, {
|
|
2206
|
-
correlator: this.viewCorrelator,
|
|
2207
|
-
streamCorrelator: this.streamCorrelator,
|
|
2208
|
-
pod: this.podCounter > 0 ? this.podCounter : void 0,
|
|
2209
|
-
adPosition: this.adRequestPositionInBreak,
|
|
2210
|
-
isCtv: envSignals.isCtv,
|
|
2211
|
-
contentUrl: envSignals.contentUrl,
|
|
2212
|
-
pageUrl: !envSignals.isCtv && typeof window !== "undefined" ? window.location.href : void 0,
|
|
2213
|
-
adWillPlayMuted: adWillPlayMuted,
|
|
2214
|
-
adWillAutoPlay: !!this.config.autoplay,
|
|
2215
|
-
appId: envSignals.appId,
|
|
2216
|
-
appName: envSignals.appName,
|
|
2217
|
-
sessionId: envSignals.sessionId,
|
|
2218
|
-
deviceId: envSignals.deviceId,
|
|
2219
|
-
deviceIdType: envSignals.deviceIdType,
|
|
2220
|
-
limitAdTracking: envSignals.limitAdTracking,
|
|
2221
|
-
deviceTypeHint: envSignals.deviceTypeHint,
|
|
2222
|
-
adTest: this.config.adTest,
|
|
2223
|
-
consent: this.consentSignals
|
|
2224
|
-
});
|
|
2225
|
-
var finalUrl = palNonce.injectNonce(urlWithMacros);
|
|
2226
|
-
console.log("[StormcloudVideoPlayer] Resolved ad request URL (pod=".concat(this.podCounter, ", pos=").concat(this.adRequestPositionInBreak, "):"), finalUrl);
|
|
2227
|
-
urls.push(finalUrl);
|
|
2228
|
-
}
|
|
2229
|
-
return urls;
|
|
2230
2189
|
}
|
|
2231
2190
|
},
|
|
2232
2191
|
{
|
|
2233
2192
|
key: "resolvePodParams",
|
|
2234
2193
|
value: function resolvePodParams(breakDurationMs) {
|
|
2235
|
-
var maxDurationMs = breakDurationMs != null && breakDurationMs > 0 ? breakDurationMs : this.config.podMaxDurationMs;
|
|
2194
|
+
var maxDurationMs = breakDurationMs != null && breakDurationMs > 0 ? breakDurationMs : this.config.podMaxDurationMs != null && this.config.podMaxDurationMs > 0 ? this.config.podMaxDurationMs : this.defaultPodMaxDurationMs;
|
|
2236
2195
|
var maxAds = this.config.podMaxAds && this.config.podMaxAds > 0 ? this.config.podMaxAds : this.apiNumberAds && this.apiNumberAds > 0 ? this.apiNumberAds : this.defaultPodMaxAds;
|
|
2237
2196
|
var minDurationMs = this.config.podExactDuration && maxDurationMs != null ? maxDurationMs : 0;
|
|
2238
2197
|
return {
|