stormcloud-video-player 0.8.65 → 0.8.66
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/StormcloudPlayer.cjs +1006 -820
- package/lib/StormcloudPlayer.cjs.map +1 -1
- package/lib/index.cjs +970 -820
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.ts +3 -0
- package/lib/index.js +970 -820
- package/lib/index.js.map +1 -1
- package/lib/player/AdBreakOrchestrator.cjs +674 -741
- package/lib/player/AdBreakOrchestrator.cjs.map +1 -1
- package/lib/player/AdBreakOrchestrator.d.cts +34 -16
- package/lib/player/AdConfigManager.cjs +16 -1
- package/lib/player/AdConfigManager.cjs.map +1 -1
- package/lib/player/StormcloudVideoPlayer.cjs +1006 -820
- package/lib/player/StormcloudVideoPlayer.cjs.map +1 -1
- package/lib/players/HlsPlayer.cjs +1006 -820
- package/lib/players/HlsPlayer.cjs.map +1 -1
- package/lib/players/index.cjs +1006 -820
- package/lib/players/index.cjs.map +1 -1
- package/lib/sdk/hlsAdPlayer.cjs +293 -78
- package/lib/sdk/hlsAdPlayer.cjs.map +1 -1
- package/lib/types.d.cts +3 -0
- package/lib/ui/StormcloudVideoPlayer.cjs +970 -820
- package/lib/ui/StormcloudVideoPlayer.cjs.map +1 -1
- package/lib/utils/vastMacros.cjs +19 -0
- package/lib/utils/vastMacros.cjs.map +1 -1
- package/lib/utils/vastMacros.d.cts +2 -1
- package/package.json +1 -1
|
@@ -24,13 +24,19 @@ interface AdBreakOrchestratorHost {
|
|
|
24
24
|
onAdClick(): void;
|
|
25
25
|
onAdInteraction(event: MouseEvent | TouchEvent): void;
|
|
26
26
|
}
|
|
27
|
+
type AdSlotState = "IDLE" | "REQUESTING" | "READY" | "PLAYING" | "NEEDS_NEXT_AD" | "ENDING";
|
|
27
28
|
declare class AdBreakOrchestrator {
|
|
28
29
|
inAdBreak: boolean;
|
|
29
30
|
showAds: boolean;
|
|
30
31
|
isShowingPlaceholder: boolean;
|
|
31
32
|
adDetectSentForCurrentBreak: boolean;
|
|
32
|
-
private
|
|
33
|
-
private
|
|
33
|
+
private slotState;
|
|
34
|
+
private breakSource;
|
|
35
|
+
private followUpBaseVastUrl;
|
|
36
|
+
private unusableResponsesInBreak;
|
|
37
|
+
private nextAdTimerId;
|
|
38
|
+
private controllerGeneration;
|
|
39
|
+
private readonly requestDiagnostics;
|
|
34
40
|
private currentVastUrl;
|
|
35
41
|
private breakFunnel;
|
|
36
42
|
private controllerCallInFlight;
|
|
@@ -39,9 +45,9 @@ declare class AdBreakOrchestrator {
|
|
|
39
45
|
private requestStartedAt;
|
|
40
46
|
private opportunityBreakKey;
|
|
41
47
|
private opportunityEpoch;
|
|
42
|
-
adRequestQueue: string[];
|
|
43
48
|
adPodQueue: string[];
|
|
44
|
-
private readonly
|
|
49
|
+
private readonly defaultMinRemainingMsToRequestAd;
|
|
50
|
+
private readonly defaultMaxNoFillsPerBreak;
|
|
45
51
|
pendingAdBreak: {
|
|
46
52
|
marker: Scte35Marker;
|
|
47
53
|
detectedAtFragmentSn?: number;
|
|
@@ -60,15 +66,28 @@ declare class AdBreakOrchestrator {
|
|
|
60
66
|
private get analyticsContext();
|
|
61
67
|
private nextAdRequestUrl;
|
|
62
68
|
attachImaEventListeners(): void;
|
|
63
|
-
recreateAdController(): void;
|
|
69
|
+
recreateAdController(reason: string): void;
|
|
64
70
|
clearPendingAdBreak(): void;
|
|
65
|
-
|
|
71
|
+
isBreakActive(): boolean;
|
|
72
|
+
getSlotState(): AdSlotState;
|
|
73
|
+
beginVmapBreak(breakKey: string): void;
|
|
74
|
+
handleAdStart(marker: Scte35Marker): Promise<void>;
|
|
66
75
|
private startOptimizedPod;
|
|
67
|
-
private
|
|
68
|
-
private
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
private
|
|
76
|
+
private setSlotState;
|
|
77
|
+
private isStale;
|
|
78
|
+
private getMinRemainingMsToRequestAd;
|
|
79
|
+
private getMaxNoFillsPerBreak;
|
|
80
|
+
private isBreakTimeBounded;
|
|
81
|
+
private getStopRequestingReason;
|
|
82
|
+
private getNextRequestDelayMs;
|
|
83
|
+
requestNextAd(trigger: string): void;
|
|
84
|
+
private requestFollowUpAd;
|
|
85
|
+
continueAfterRequestFailure(epoch?: number): void;
|
|
86
|
+
cancelScheduledRequest(): void;
|
|
87
|
+
noteVastUrlGenerated(url: string, source: string): void;
|
|
88
|
+
private recordRequestFailure;
|
|
89
|
+
private recordRequestDiagnostic;
|
|
90
|
+
private finalizeRequestDiagnostics;
|
|
72
91
|
private withCurrentPodBudget;
|
|
73
92
|
private countFunnelStage;
|
|
74
93
|
private logOrchestratorFunnel;
|
|
@@ -78,15 +97,14 @@ declare class AdBreakOrchestrator {
|
|
|
78
97
|
noteStopBeforeStart(reason: string): void;
|
|
79
98
|
handleRequestWatchdogTimeout(): void;
|
|
80
99
|
private callController;
|
|
81
|
-
playSingleAd(vastTagUrl: string): Promise<void>;
|
|
82
|
-
private showPlaceholderAndWaitForAds;
|
|
100
|
+
playSingleAd(vastTagUrl: string, trigger?: string): Promise<void>;
|
|
83
101
|
private logBreakFunnel;
|
|
84
|
-
handleAdPodComplete(): void;
|
|
102
|
+
handleAdPodComplete(reason?: string): void;
|
|
85
103
|
private getBufferedAhead;
|
|
86
104
|
private describeVideoState;
|
|
87
105
|
private monitorLiveResumeStall;
|
|
88
106
|
private resumeContentPlayback;
|
|
89
|
-
handleAdFailure(): void;
|
|
107
|
+
handleAdFailure(reason?: string): void;
|
|
90
108
|
}
|
|
91
109
|
|
|
92
|
-
export { AdBreakOrchestrator, type AdBreakOrchestratorHost };
|
|
110
|
+
export { AdBreakOrchestrator, type AdBreakOrchestratorHost, type AdSlotState };
|
|
@@ -1224,6 +1224,21 @@ function normalizeVastTagUrl(raw) {
|
|
|
1224
1224
|
return raw;
|
|
1225
1225
|
}
|
|
1226
1226
|
}
|
|
1227
|
+
var GAM_AD_HOSTS = /* @__PURE__ */ new Set([
|
|
1228
|
+
"pubads.g.doubleclick.net",
|
|
1229
|
+
"securepubads.g.doubleclick.net"
|
|
1230
|
+
]);
|
|
1231
|
+
function ensureVideoAdType(rawUrl) {
|
|
1232
|
+
try {
|
|
1233
|
+
var url = new URL(rawUrl);
|
|
1234
|
+
if (!GAM_AD_HOSTS.has(url.hostname)) return rawUrl;
|
|
1235
|
+
if (url.searchParams.has("ad_type")) return rawUrl;
|
|
1236
|
+
url.searchParams.set("ad_type", "video");
|
|
1237
|
+
return url.toString();
|
|
1238
|
+
} catch (unused) {
|
|
1239
|
+
return rawUrl;
|
|
1240
|
+
}
|
|
1241
|
+
}
|
|
1227
1242
|
function applyVastMacros(baseUrl, ctx) {
|
|
1228
1243
|
var expandedUrl = expandInlineMacroPlaceholders(baseUrl, ctx);
|
|
1229
1244
|
var url;
|
|
@@ -2390,7 +2405,7 @@ var AdConfigManager = /*#__PURE__*/ function() {
|
|
|
2390
2405
|
} : {}), {
|
|
2391
2406
|
consent: this.consentSignals
|
|
2392
2407
|
}));
|
|
2393
|
-
var finalUrl = palNonce.injectNonce(urlWithMacros);
|
|
2408
|
+
var finalUrl = palNonce.injectNonce(ensureVideoAdType(urlWithMacros));
|
|
2394
2409
|
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);
|
|
2395
2410
|
return finalUrl;
|
|
2396
2411
|
}
|