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
|
@@ -1613,6 +1613,41 @@ function createHlsAdPlayer(contentVideo, options) {
|
|
|
1613
1613
|
}
|
|
1614
1614
|
};
|
|
1615
1615
|
}
|
|
1616
|
+
// src/utils/devUrl.ts
|
|
1617
|
+
var PRIVATE_HOST_PATTERNS = [
|
|
1618
|
+
/^localhost$/i,
|
|
1619
|
+
/^127\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,
|
|
1620
|
+
/^0\.0\.0\.0$/,
|
|
1621
|
+
/^::1$/,
|
|
1622
|
+
/^10\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,
|
|
1623
|
+
/^192\.168\.\d{1,3}\.\d{1,3}$/,
|
|
1624
|
+
/^172\.(1[6-9]|2\d|3[0-1])\.\d{1,3}\.\d{1,3}$/
|
|
1625
|
+
];
|
|
1626
|
+
function isLocalDevHost(hostname) {
|
|
1627
|
+
var host = hostname.replace(/^\[/, "").replace(/\]$/, "").toLowerCase();
|
|
1628
|
+
if (!host) return false;
|
|
1629
|
+
if (host.endsWith(".local") || host.endsWith(".localhost")) return true;
|
|
1630
|
+
return PRIVATE_HOST_PATTERNS.some(function(pattern) {
|
|
1631
|
+
return pattern.test(host);
|
|
1632
|
+
});
|
|
1633
|
+
}
|
|
1634
|
+
function toDevSafeUrl(rawUrl) {
|
|
1635
|
+
if (!rawUrl) return rawUrl !== null && rawUrl !== void 0 ? rawUrl : "";
|
|
1636
|
+
var url;
|
|
1637
|
+
try {
|
|
1638
|
+
url = new URL(rawUrl);
|
|
1639
|
+
} catch (unused) {
|
|
1640
|
+
return rawUrl;
|
|
1641
|
+
}
|
|
1642
|
+
if (url.protocol !== "http:" && url.protocol !== "https:") {
|
|
1643
|
+
return rawUrl;
|
|
1644
|
+
}
|
|
1645
|
+
if (!isLocalDevHost(url.hostname)) {
|
|
1646
|
+
return rawUrl;
|
|
1647
|
+
}
|
|
1648
|
+
var cleanPath = url.pathname.replace(/\/{2,}/g, "/") || "/index.html";
|
|
1649
|
+
return "file://".concat(cleanPath);
|
|
1650
|
+
}
|
|
1616
1651
|
// src/sdk/pal.ts
|
|
1617
1652
|
var PAL_SDK_URL = "https://imasdk.googleapis.com/pal/sdkloader/pal.js";
|
|
1618
1653
|
var _nonceLoader;
|
|
@@ -1699,17 +1734,17 @@ function createPalNonceManager() {
|
|
|
1699
1734
|
request.adWillPlayMuted = (_options_adWillPlayMuted = options.adWillPlayMuted) !== null && _options_adWillPlayMuted !== void 0 ? _options_adWillPlayMuted : false;
|
|
1700
1735
|
request.playerVolume = (_options_playerVolume = options.playerVolume) !== null && _options_playerVolume !== void 0 ? _options_playerVolume : request.adWillPlayMuted ? 0 : 1;
|
|
1701
1736
|
request.continuousPlayback = (_options_continuousPlayback = options.continuousPlayback) !== null && _options_continuousPlayback !== void 0 ? _options_continuousPlayback : true;
|
|
1702
|
-
request.descriptionUrl = options.descriptionUrl || (typeof window !== "undefined" ? window.location.href : "");
|
|
1737
|
+
request.descriptionUrl = toDevSafeUrl(options.descriptionUrl || (typeof window !== "undefined" ? window.location.href : ""));
|
|
1703
1738
|
request.iconsSupported = true;
|
|
1704
1739
|
request.playerType = "StormcloudVideoPlayer";
|
|
1705
1740
|
request.playerVersion = "1.0";
|
|
1706
1741
|
request.supportedApiFrameworks = "2,7,9";
|
|
1707
|
-
request.url = options.descriptionUrl || (typeof window !== "undefined" ? window.location.href : "");
|
|
1742
|
+
request.url = toDevSafeUrl(options.descriptionUrl || (typeof window !== "undefined" ? window.location.href : ""));
|
|
1708
1743
|
request.videoWidth = options.videoWidth || 640;
|
|
1709
1744
|
request.videoHeight = options.videoHeight || 480;
|
|
1710
1745
|
if (options.ppid) request.ppid = options.ppid;
|
|
1711
1746
|
if (options.sessionId) request.sessionId = options.sessionId;
|
|
1712
|
-
console.log("[PAL] NonceRequest before generateNonce:", {
|
|
1747
|
+
console.log("[PAL] NonceRequest before generateNonce:", JSON.stringify({
|
|
1713
1748
|
adWillAutoPlay: request.adWillAutoPlay,
|
|
1714
1749
|
adWillPlayMuted: request.adWillPlayMuted,
|
|
1715
1750
|
playerVolume: request.playerVolume,
|
|
@@ -1724,7 +1759,7 @@ function createPalNonceManager() {
|
|
|
1724
1759
|
videoHeight: request.videoHeight,
|
|
1725
1760
|
ppid: request.ppid,
|
|
1726
1761
|
sessionId: request.sessionId
|
|
1727
|
-
});
|
|
1762
|
+
}, null, 2));
|
|
1728
1763
|
return [
|
|
1729
1764
|
4,
|
|
1730
1765
|
loader.loadNonceManager(request)
|
|
@@ -5323,7 +5358,7 @@ var AdConfigManager = /*#__PURE__*/ function() {
|
|
|
5323
5358
|
podMaxDurationMs: podParams.maxDurationMs,
|
|
5324
5359
|
isCtv: envSignals.isCtv,
|
|
5325
5360
|
contentUrl: envSignals.contentUrl,
|
|
5326
|
-
pageUrl: !envSignals.isCtv && typeof window !== "undefined" ? window.location.href : void 0,
|
|
5361
|
+
pageUrl: !envSignals.isCtv && typeof window !== "undefined" ? toDevSafeUrl(window.location.href) : void 0,
|
|
5327
5362
|
adWillPlayMuted: adWillPlayMuted,
|
|
5328
5363
|
adWillAutoPlay: !!this.config.autoplay,
|
|
5329
5364
|
appId: envSignals.appId,
|