stormcloud-video-player 0.8.32 → 0.8.34
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 +40 -5
- package/lib/index.cjs.map +1 -1
- package/lib/index.js +40 -5
- package/lib/index.js.map +1 -1
- package/lib/player/AdBreakOrchestrator.d.cts +1 -1
- 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 +40 -5
- 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 +40 -5
- package/lib/players/HlsPlayer.cjs.map +1 -1
- package/lib/players/HlsPlayer.d.cts +1 -1
- package/lib/players/index.cjs +40 -5
- package/lib/players/index.cjs.map +1 -1
- package/lib/sdk/hlsAdPlayer.d.cts +1 -1
- package/lib/sdk/pal.cjs +40 -4
- package/lib/sdk/pal.cjs.map +1 -1
- package/lib/ui/StormcloudVideoPlayer.cjs +40 -5
- package/lib/ui/StormcloudVideoPlayer.cjs.map +1 -1
- package/lib/ui/StormcloudVideoPlayer.d.cts +1 -1
- 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
- package/lib/types-e6QV7SBp.d.cts +0 -132
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { S as Scte35Marker, a as StormcloudVideoPlayerConfig, A as AdController } from '../types-CSHvCbhZ.cjs';
|
|
2
2
|
import { AdTimingService } from './AdTimingService.cjs';
|
|
3
3
|
import { AdConfigManager } from './AdConfigManager.cjs';
|
|
4
4
|
import { Scte35CueManager } from './Scte35CueManager.cjs';
|
|
@@ -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,
|