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
package/lib/index.cjs
CHANGED
|
@@ -1800,6 +1800,41 @@ function createHlsAdPlayer(contentVideo, options) {
|
|
|
1800
1800
|
}
|
|
1801
1801
|
};
|
|
1802
1802
|
}
|
|
1803
|
+
// src/utils/devUrl.ts
|
|
1804
|
+
var PRIVATE_HOST_PATTERNS = [
|
|
1805
|
+
/^localhost$/i,
|
|
1806
|
+
/^127\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,
|
|
1807
|
+
/^0\.0\.0\.0$/,
|
|
1808
|
+
/^::1$/,
|
|
1809
|
+
/^10\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,
|
|
1810
|
+
/^192\.168\.\d{1,3}\.\d{1,3}$/,
|
|
1811
|
+
/^172\.(1[6-9]|2\d|3[0-1])\.\d{1,3}\.\d{1,3}$/
|
|
1812
|
+
];
|
|
1813
|
+
function isLocalDevHost(hostname) {
|
|
1814
|
+
var host = hostname.replace(/^\[/, "").replace(/\]$/, "").toLowerCase();
|
|
1815
|
+
if (!host) return false;
|
|
1816
|
+
if (host.endsWith(".local") || host.endsWith(".localhost")) return true;
|
|
1817
|
+
return PRIVATE_HOST_PATTERNS.some(function(pattern) {
|
|
1818
|
+
return pattern.test(host);
|
|
1819
|
+
});
|
|
1820
|
+
}
|
|
1821
|
+
function toDevSafeUrl(rawUrl) {
|
|
1822
|
+
if (!rawUrl) return rawUrl !== null && rawUrl !== void 0 ? rawUrl : "";
|
|
1823
|
+
var url;
|
|
1824
|
+
try {
|
|
1825
|
+
url = new URL(rawUrl);
|
|
1826
|
+
} catch (unused) {
|
|
1827
|
+
return rawUrl;
|
|
1828
|
+
}
|
|
1829
|
+
if (url.protocol !== "http:" && url.protocol !== "https:") {
|
|
1830
|
+
return rawUrl;
|
|
1831
|
+
}
|
|
1832
|
+
if (!isLocalDevHost(url.hostname)) {
|
|
1833
|
+
return rawUrl;
|
|
1834
|
+
}
|
|
1835
|
+
var cleanPath = url.pathname.replace(/\/{2,}/g, "/") || "/index.html";
|
|
1836
|
+
return "file://".concat(cleanPath);
|
|
1837
|
+
}
|
|
1803
1838
|
// src/sdk/pal.ts
|
|
1804
1839
|
var PAL_SDK_URL = "https://imasdk.googleapis.com/pal/sdkloader/pal.js";
|
|
1805
1840
|
var _nonceLoader;
|
|
@@ -1886,17 +1921,17 @@ function createPalNonceManager() {
|
|
|
1886
1921
|
request.adWillPlayMuted = (_options_adWillPlayMuted = options.adWillPlayMuted) !== null && _options_adWillPlayMuted !== void 0 ? _options_adWillPlayMuted : false;
|
|
1887
1922
|
request.playerVolume = (_options_playerVolume = options.playerVolume) !== null && _options_playerVolume !== void 0 ? _options_playerVolume : request.adWillPlayMuted ? 0 : 1;
|
|
1888
1923
|
request.continuousPlayback = (_options_continuousPlayback = options.continuousPlayback) !== null && _options_continuousPlayback !== void 0 ? _options_continuousPlayback : true;
|
|
1889
|
-
request.descriptionUrl = options.descriptionUrl || (typeof window !== "undefined" ? window.location.href : "");
|
|
1924
|
+
request.descriptionUrl = toDevSafeUrl(options.descriptionUrl || (typeof window !== "undefined" ? window.location.href : ""));
|
|
1890
1925
|
request.iconsSupported = true;
|
|
1891
1926
|
request.playerType = "StormcloudVideoPlayer";
|
|
1892
1927
|
request.playerVersion = "1.0";
|
|
1893
1928
|
request.supportedApiFrameworks = "2,7,9";
|
|
1894
|
-
request.url = options.descriptionUrl || (typeof window !== "undefined" ? window.location.href : "");
|
|
1929
|
+
request.url = toDevSafeUrl(options.descriptionUrl || (typeof window !== "undefined" ? window.location.href : ""));
|
|
1895
1930
|
request.videoWidth = options.videoWidth || 640;
|
|
1896
1931
|
request.videoHeight = options.videoHeight || 480;
|
|
1897
1932
|
if (options.ppid) request.ppid = options.ppid;
|
|
1898
1933
|
if (options.sessionId) request.sessionId = options.sessionId;
|
|
1899
|
-
console.log("[PAL] NonceRequest before generateNonce:", {
|
|
1934
|
+
console.log("[PAL] NonceRequest before generateNonce:", JSON.stringify({
|
|
1900
1935
|
adWillAutoPlay: request.adWillAutoPlay,
|
|
1901
1936
|
adWillPlayMuted: request.adWillPlayMuted,
|
|
1902
1937
|
playerVolume: request.playerVolume,
|
|
@@ -1911,7 +1946,7 @@ function createPalNonceManager() {
|
|
|
1911
1946
|
videoHeight: request.videoHeight,
|
|
1912
1947
|
ppid: request.ppid,
|
|
1913
1948
|
sessionId: request.sessionId
|
|
1914
|
-
});
|
|
1949
|
+
}, null, 2));
|
|
1915
1950
|
return [
|
|
1916
1951
|
4,
|
|
1917
1952
|
loader.loadNonceManager(request)
|
|
@@ -5557,7 +5592,7 @@ var AdConfigManager = /*#__PURE__*/ function() {
|
|
|
5557
5592
|
podMaxDurationMs: podParams.maxDurationMs,
|
|
5558
5593
|
isCtv: envSignals.isCtv,
|
|
5559
5594
|
contentUrl: envSignals.contentUrl,
|
|
5560
|
-
pageUrl: !envSignals.isCtv && typeof window !== "undefined" ? window.location.href : void 0,
|
|
5595
|
+
pageUrl: !envSignals.isCtv && typeof window !== "undefined" ? toDevSafeUrl(window.location.href) : void 0,
|
|
5561
5596
|
adWillPlayMuted: adWillPlayMuted,
|
|
5562
5597
|
adWillAutoPlay: !!this.config.autoplay,
|
|
5563
5598
|
appId: envSignals.appId,
|