stormcloud-video-player 0.8.25 → 0.8.26
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 +631 -115
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +7 -0
- package/lib/index.d.ts +7 -0
- package/lib/index.js +631 -115
- package/lib/index.js.map +1 -1
- package/lib/player/AdBreakOrchestrator.cjs +198 -41
- package/lib/player/AdBreakOrchestrator.cjs.map +1 -1
- package/lib/player/AdBreakOrchestrator.d.cts +4 -1
- package/lib/player/AdConfigManager.cjs +61 -1
- package/lib/player/AdConfigManager.cjs.map +1 -1
- package/lib/player/AdConfigManager.d.cts +12 -1
- package/lib/player/AdPreloadPool.d.cts +1 -1
- package/lib/player/AdTimingService.cjs +7 -0
- package/lib/player/AdTimingService.cjs.map +1 -1
- package/lib/player/AdTimingService.d.cts +2 -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 +631 -115
- package/lib/player/StormcloudVideoPlayer.cjs.map +1 -1
- package/lib/player/StormcloudVideoPlayer.d.cts +2 -1
- package/lib/player/playerTypes.d.cts +1 -1
- package/lib/players/HlsPlayer.cjs +631 -115
- package/lib/players/HlsPlayer.cjs.map +1 -1
- package/lib/players/HlsPlayer.d.cts +1 -1
- package/lib/players/index.cjs +631 -115
- package/lib/players/index.cjs.map +1 -1
- package/lib/sdk/hlsAdPlayer.cjs +343 -71
- package/lib/sdk/hlsAdPlayer.cjs.map +1 -1
- package/lib/sdk/hlsAdPlayer.d.cts +1 -1
- package/lib/{types-Bz4aRmzc.d.cts → types-Xgz2_W1C.d.cts} +6 -0
- package/lib/ui/StormcloudVideoPlayer.cjs +631 -115
- 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 +14 -1
- package/lib/utils/vastMacros.cjs.map +1 -1
- package/lib/utils/vastMacros.d.cts +3 -0
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
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-Xgz2_W1C.cjs';
|
|
2
2
|
import { AdTimingService } from './AdTimingService.cjs';
|
|
3
3
|
import { AdPreloadPool } from './AdPreloadPool.cjs';
|
|
4
4
|
import { AdConfigManager } from './AdConfigManager.cjs';
|
|
@@ -17,6 +17,7 @@ interface AdBreakOrchestratorHost {
|
|
|
17
17
|
shouldContinueLiveStreamDuringAds(): boolean;
|
|
18
18
|
getLiveSyncPosition(): number | undefined;
|
|
19
19
|
generateVastUrls(baseUrl: string, count: number): string[];
|
|
20
|
+
generatePodVastUrl(baseUrl: string, breakDurationMs?: number): string;
|
|
20
21
|
}
|
|
21
22
|
declare class AdBreakOrchestrator {
|
|
22
23
|
inAdBreak: boolean;
|
|
@@ -45,10 +46,12 @@ declare class AdBreakOrchestrator {
|
|
|
45
46
|
constructor(host: AdBreakOrchestratorHost, timing: AdTimingService, preloadPool: AdPreloadPool, adConfig: AdConfigManager, cueManager: Scte35CueManager, placeholder: PlaceholderLayer);
|
|
46
47
|
private get debug();
|
|
47
48
|
private get analyticsContext();
|
|
49
|
+
private get optimizedPodsEnabled();
|
|
48
50
|
attachImaEventListeners(): void;
|
|
49
51
|
recreateAdController(): void;
|
|
50
52
|
clearPendingAdBreak(): void;
|
|
51
53
|
handleAdStart(_marker: Scte35Marker): Promise<void>;
|
|
54
|
+
private startOptimizedPod;
|
|
52
55
|
private swapToPreloadedAdPlayer;
|
|
53
56
|
private startContinuousFetching;
|
|
54
57
|
private continuousFetchLoop;
|
|
@@ -1085,7 +1085,20 @@ function applyVastMacros(baseUrl, ctx) {
|
|
|
1085
1085
|
if (ctx.pod != null) {
|
|
1086
1086
|
params.set("pod", String(ctx.pod));
|
|
1087
1087
|
}
|
|
1088
|
-
|
|
1088
|
+
var optimizedPodMode = ctx.podMaxAds != null || ctx.podMinDurationMs != null || ctx.podMaxDurationMs != null;
|
|
1089
|
+
if (optimizedPodMode) {
|
|
1090
|
+
params.delete("ppos");
|
|
1091
|
+
params.delete("lip");
|
|
1092
|
+
if (ctx.podMinDurationMs != null) {
|
|
1093
|
+
params.set("pmnd", String(Math.max(0, Math.round(ctx.podMinDurationMs))));
|
|
1094
|
+
}
|
|
1095
|
+
if (ctx.podMaxDurationMs != null) {
|
|
1096
|
+
params.set("pmxd", String(Math.max(0, Math.round(ctx.podMaxDurationMs))));
|
|
1097
|
+
}
|
|
1098
|
+
if (ctx.podMaxAds != null) {
|
|
1099
|
+
params.set("pmad", String(Math.max(1, Math.round(ctx.podMaxAds))));
|
|
1100
|
+
}
|
|
1101
|
+
} else if (ctx.adPosition != null) {
|
|
1089
1102
|
params.set("ppos", String(ctx.adPosition));
|
|
1090
1103
|
}
|
|
1091
1104
|
var requestUrl = ctx.contentUrl || ctx.pageUrl;
|
|
@@ -1689,6 +1702,7 @@ var AdConfigManager = /*#__PURE__*/ function() {
|
|
|
1689
1702
|
this.podAssignedByPrefetch = false;
|
|
1690
1703
|
this.adRequestPositionInBreak = 0;
|
|
1691
1704
|
this.lastHeartbeatTime = 0;
|
|
1705
|
+
this.defaultPodMaxAds = 6;
|
|
1692
1706
|
this.config = config;
|
|
1693
1707
|
this.video = video;
|
|
1694
1708
|
}
|
|
@@ -2144,6 +2158,52 @@ var AdConfigManager = /*#__PURE__*/ function() {
|
|
|
2144
2158
|
return urls;
|
|
2145
2159
|
}
|
|
2146
2160
|
},
|
|
2161
|
+
{
|
|
2162
|
+
key: "resolvePodParams",
|
|
2163
|
+
value: function resolvePodParams(breakDurationMs) {
|
|
2164
|
+
var maxDurationMs = breakDurationMs != null && breakDurationMs > 0 ? breakDurationMs : this.config.podMaxDurationMs;
|
|
2165
|
+
var maxAds = this.config.podMaxAds && this.config.podMaxAds > 0 ? this.config.podMaxAds : this.apiNumberAds && this.apiNumberAds > 0 ? this.apiNumberAds : this.defaultPodMaxAds;
|
|
2166
|
+
var minDurationMs = this.config.podExactDuration && maxDurationMs != null ? maxDurationMs : 0;
|
|
2167
|
+
return {
|
|
2168
|
+
maxAds: maxAds,
|
|
2169
|
+
minDurationMs: minDurationMs,
|
|
2170
|
+
maxDurationMs: maxDurationMs
|
|
2171
|
+
};
|
|
2172
|
+
}
|
|
2173
|
+
},
|
|
2174
|
+
{
|
|
2175
|
+
key: "generatePodVastUrl",
|
|
2176
|
+
value: function generatePodVastUrl(baseUrl, podParams, adPlayer, palNonce, inAdBreak) {
|
|
2177
|
+
var _podParams_maxDurationMs;
|
|
2178
|
+
var adWillPlayMuted = inAdBreak ? adPlayer.getOriginalMutedState() : this.video.muted;
|
|
2179
|
+
var envSignals = resolveVastEnvironmentSignals(!!this.config.ctvAdRequest);
|
|
2180
|
+
var urlWithMacros = applyVastMacros(baseUrl, {
|
|
2181
|
+
correlator: generateCorrelator(),
|
|
2182
|
+
streamCorrelator: this.streamCorrelator,
|
|
2183
|
+
pod: this.podCounter > 0 ? this.podCounter : void 0,
|
|
2184
|
+
podMaxAds: podParams.maxAds,
|
|
2185
|
+
podMinDurationMs: podParams.minDurationMs,
|
|
2186
|
+
podMaxDurationMs: podParams.maxDurationMs,
|
|
2187
|
+
isCtv: envSignals.isCtv,
|
|
2188
|
+
contentUrl: envSignals.contentUrl,
|
|
2189
|
+
pageUrl: !envSignals.isCtv && typeof window !== "undefined" ? window.location.href : void 0,
|
|
2190
|
+
adWillPlayMuted: adWillPlayMuted,
|
|
2191
|
+
adWillAutoPlay: !!this.config.autoplay,
|
|
2192
|
+
appId: envSignals.appId,
|
|
2193
|
+
appName: envSignals.appName,
|
|
2194
|
+
sessionId: envSignals.sessionId,
|
|
2195
|
+
deviceId: envSignals.deviceId,
|
|
2196
|
+
deviceIdType: envSignals.deviceIdType,
|
|
2197
|
+
limitAdTracking: envSignals.limitAdTracking,
|
|
2198
|
+
deviceTypeHint: envSignals.deviceTypeHint,
|
|
2199
|
+
adTest: this.config.adTest,
|
|
2200
|
+
consent: this.consentSignals
|
|
2201
|
+
});
|
|
2202
|
+
var finalUrl = palNonce.injectNonce(urlWithMacros);
|
|
2203
|
+
console.log("[StormcloudVideoPlayer] Resolved optimized-pod request URL (pod=".concat(this.podCounter, ", pmad=").concat(podParams.maxAds, ", pmnd=").concat(podParams.minDurationMs, ", pmxd=").concat((_podParams_maxDurationMs = podParams.maxDurationMs) !== null && _podParams_maxDurationMs !== void 0 ? _podParams_maxDurationMs : "?", "):"), finalUrl);
|
|
2204
|
+
return finalUrl;
|
|
2205
|
+
}
|
|
2206
|
+
},
|
|
2147
2207
|
{
|
|
2148
2208
|
// --- Tracking ---
|
|
2149
2209
|
key: "initializeTracking",
|