stormcloud-video-player 0.8.33 → 0.8.35
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 +143 -19
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +2 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +143 -19
- package/lib/index.js.map +1 -1
- package/lib/player/AdBreakOrchestrator.cjs +36 -16
- package/lib/player/AdBreakOrchestrator.cjs.map +1 -1
- package/lib/player/AdBreakOrchestrator.d.cts +3 -7
- package/lib/player/AdConfigManager.cjs +36 -1
- package/lib/player/AdConfigManager.cjs.map +1 -1
- package/lib/player/AdConfigManager.d.cts +1 -1
- 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 +143 -19
- package/lib/player/StormcloudVideoPlayer.cjs.map +1 -1
- package/lib/player/StormcloudVideoPlayer.d.cts +1 -1
- package/lib/player/playerTypes.d.cts +1 -1
- package/lib/players/HlsPlayer.cjs +143 -19
- package/lib/players/HlsPlayer.cjs.map +1 -1
- package/lib/players/HlsPlayer.d.cts +1 -1
- package/lib/players/index.cjs +143 -19
- package/lib/players/index.cjs.map +1 -1
- package/lib/sdk/hlsAdPlayer.cjs +62 -0
- package/lib/sdk/hlsAdPlayer.cjs.map +1 -1
- package/lib/sdk/hlsAdPlayer.d.cts +1 -1
- package/lib/sdk/pal.cjs +38 -2
- package/lib/sdk/pal.cjs.map +1 -1
- package/lib/{types-CSHvCbhZ.d.cts → types-cTqIKw_D.d.cts} +1 -0
- package/lib/ui/StormcloudVideoPlayer.cjs +143 -19
- package/lib/ui/StormcloudVideoPlayer.cjs.map +1 -1
- package/lib/ui/StormcloudVideoPlayer.d.cts +1 -1
- package/lib/utils/browserCompat.cjs +1 -0
- package/lib/utils/browserCompat.cjs.map +1 -1
- package/lib/utils/browserCompat.d.cts +1 -0
- package/lib/utils/devUrl.cjs +102 -0
- package/lib/utils/devUrl.cjs.map +1 -0
- package/lib/utils/devUrl.d.cts +4 -0
- package/lib/utils/tracking.d.cts +1 -1
- 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-cTqIKw_D.cjs';
|
|
2
2
|
import { AdTimingService } from './AdTimingService.cjs';
|
|
3
3
|
import { AdConfigManager } from './AdConfigManager.cjs';
|
|
4
4
|
import { Scte35CueManager } from './Scte35CueManager.cjs';
|
|
@@ -14,6 +14,7 @@ interface AdBreakOrchestratorHost {
|
|
|
14
14
|
setAdPlayer(player: AdController): void;
|
|
15
15
|
createAdPlayer(continueLiveStreamDuringAds: boolean): AdController;
|
|
16
16
|
shouldContinueLiveStreamDuringAds(): boolean;
|
|
17
|
+
isLiveStream(): boolean;
|
|
17
18
|
getLiveSyncPosition(): number | undefined;
|
|
18
19
|
generatePodVastUrl(baseUrl: string, breakDurationMs?: number): string;
|
|
19
20
|
}
|
|
@@ -43,12 +44,6 @@ declare class AdBreakOrchestrator {
|
|
|
43
44
|
constructor(host: AdBreakOrchestratorHost, timing: AdTimingService, adConfig: AdConfigManager, cueManager: Scte35CueManager, placeholder: PlaceholderLayer);
|
|
44
45
|
private get debug();
|
|
45
46
|
private get analyticsContext();
|
|
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
47
|
private nextAdRequestUrl;
|
|
53
48
|
attachImaEventListeners(): void;
|
|
54
49
|
recreateAdController(): void;
|
|
@@ -63,6 +58,7 @@ declare class AdBreakOrchestrator {
|
|
|
63
58
|
playSingleAd(vastTagUrl: string): Promise<void>;
|
|
64
59
|
private showPlaceholderAndWaitForAds;
|
|
65
60
|
handleAdPodComplete(): void;
|
|
61
|
+
private resumeContentPlayback;
|
|
66
62
|
handleAdFailure(): void;
|
|
67
63
|
}
|
|
68
64
|
|
|
@@ -1253,6 +1253,41 @@ function replaceCorrelatorFallback(baseUrl, correlator) {
|
|
|
1253
1253
|
var sep = baseUrl.includes("?") ? "&" : "?";
|
|
1254
1254
|
return "".concat(baseUrl).concat(sep, "correlator=").concat(correlator);
|
|
1255
1255
|
}
|
|
1256
|
+
// src/utils/devUrl.ts
|
|
1257
|
+
var PRIVATE_HOST_PATTERNS = [
|
|
1258
|
+
/^localhost$/i,
|
|
1259
|
+
/^127\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,
|
|
1260
|
+
/^0\.0\.0\.0$/,
|
|
1261
|
+
/^::1$/,
|
|
1262
|
+
/^10\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,
|
|
1263
|
+
/^192\.168\.\d{1,3}\.\d{1,3}$/,
|
|
1264
|
+
/^172\.(1[6-9]|2\d|3[0-1])\.\d{1,3}\.\d{1,3}$/
|
|
1265
|
+
];
|
|
1266
|
+
function isLocalDevHost(hostname) {
|
|
1267
|
+
var host = hostname.replace(/^\[/, "").replace(/\]$/, "").toLowerCase();
|
|
1268
|
+
if (!host) return false;
|
|
1269
|
+
if (host.endsWith(".local") || host.endsWith(".localhost")) return true;
|
|
1270
|
+
return PRIVATE_HOST_PATTERNS.some(function(pattern) {
|
|
1271
|
+
return pattern.test(host);
|
|
1272
|
+
});
|
|
1273
|
+
}
|
|
1274
|
+
function toDevSafeUrl(rawUrl) {
|
|
1275
|
+
if (!rawUrl) return rawUrl !== null && rawUrl !== void 0 ? rawUrl : "";
|
|
1276
|
+
var url;
|
|
1277
|
+
try {
|
|
1278
|
+
url = new URL(rawUrl);
|
|
1279
|
+
} catch (unused) {
|
|
1280
|
+
return rawUrl;
|
|
1281
|
+
}
|
|
1282
|
+
if (url.protocol !== "http:" && url.protocol !== "https:") {
|
|
1283
|
+
return rawUrl;
|
|
1284
|
+
}
|
|
1285
|
+
if (!isLocalDevHost(url.hostname)) {
|
|
1286
|
+
return rawUrl;
|
|
1287
|
+
}
|
|
1288
|
+
var cleanPath = url.pathname.replace(/\/{2,}/g, "/") || "/index.html";
|
|
1289
|
+
return "file://".concat(cleanPath);
|
|
1290
|
+
}
|
|
1256
1291
|
// src/utils/mqttConfig.ts
|
|
1257
1292
|
var DEFAULT_MQTT_CONFIG = {
|
|
1258
1293
|
enabled: true,
|
|
@@ -2216,7 +2251,7 @@ var AdConfigManager = /*#__PURE__*/ function() {
|
|
|
2216
2251
|
podMaxDurationMs: podParams.maxDurationMs,
|
|
2217
2252
|
isCtv: envSignals.isCtv,
|
|
2218
2253
|
contentUrl: envSignals.contentUrl,
|
|
2219
|
-
pageUrl: !envSignals.isCtv && typeof window !== "undefined" ? window.location.href : void 0,
|
|
2254
|
+
pageUrl: !envSignals.isCtv && typeof window !== "undefined" ? toDevSafeUrl(window.location.href) : void 0,
|
|
2220
2255
|
adWillPlayMuted: adWillPlayMuted,
|
|
2221
2256
|
adWillAutoPlay: !!this.config.autoplay,
|
|
2222
2257
|
appId: envSignals.appId,
|