stormcloud-video-player 0.2.4 → 0.2.6
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/README.md +15 -16
- package/dist/stormcloud-vp.min.js +2 -2
- package/lib/index.cjs +66 -14
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +0 -1
- package/lib/index.d.ts +0 -1
- package/lib/index.js +66 -14
- package/lib/index.js.map +1 -1
- package/lib/player/StormcloudVideoPlayer.cjs +0 -11
- package/lib/player/StormcloudVideoPlayer.cjs.map +1 -1
- package/lib/player/StormcloudVideoPlayer.d.cts +0 -1
- package/lib/players/HlsPlayer.cjs +0 -11
- package/lib/players/HlsPlayer.cjs.map +1 -1
- package/lib/players/index.cjs +0 -11
- package/lib/players/index.cjs.map +1 -1
- package/lib/ui/StormcloudVideoPlayer.cjs +66 -14
- package/lib/ui/StormcloudVideoPlayer.cjs.map +1 -1
- package/package.json +1 -1
|
@@ -1405,17 +1405,6 @@ var StormcloudVideoPlayer = class {
|
|
|
1405
1405
|
}
|
|
1406
1406
|
return true;
|
|
1407
1407
|
}
|
|
1408
|
-
async loadDefaultVastFromAdstorm(adstormApiUrl, params) {
|
|
1409
|
-
const usp = new URLSearchParams(params || {});
|
|
1410
|
-
const url = `${adstormApiUrl}?${usp.toString()}`;
|
|
1411
|
-
const res = await fetch(url);
|
|
1412
|
-
if (!res.ok) throw new Error(`Failed to fetch adstorm ads: ${res.status}`);
|
|
1413
|
-
const data = await res.json();
|
|
1414
|
-
const tag = data?.adTagUrl || data?.vastTagUrl || data?.tagUrl;
|
|
1415
|
-
if (typeof tag === "string" && tag.length > 0) {
|
|
1416
|
-
this.apiVastTagUrl = tag;
|
|
1417
|
-
}
|
|
1418
|
-
}
|
|
1419
1408
|
async handleAdStart(_marker) {
|
|
1420
1409
|
const scheduled = this.findCurrentOrNextBreak(
|
|
1421
1410
|
this.video.currentTime * 1e3
|
|
@@ -1807,6 +1796,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(
|
|
|
1807
1796
|
const [isLoading, setIsLoading] = import_react.default.useState(true);
|
|
1808
1797
|
const [isBuffering, setIsBuffering] = import_react.default.useState(false);
|
|
1809
1798
|
const [showCenterPlay, setShowCenterPlay] = import_react.default.useState(false);
|
|
1799
|
+
const [showLicenseWarning, setShowLicenseWarning] = import_react.default.useState(false);
|
|
1810
1800
|
const formatTime = (seconds) => {
|
|
1811
1801
|
if (!isFinite(seconds)) return "0:00:00";
|
|
1812
1802
|
const hours = Math.floor(seconds / 3600);
|
|
@@ -1864,6 +1854,15 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(
|
|
|
1864
1854
|
if (typeof window === "undefined") return;
|
|
1865
1855
|
const el = videoRef.current;
|
|
1866
1856
|
if (!el || !src) return;
|
|
1857
|
+
if (!licenseKey) {
|
|
1858
|
+
setShowLicenseWarning(true);
|
|
1859
|
+
setIsLoading(false);
|
|
1860
|
+
console.warn(
|
|
1861
|
+
"StormcloudVideoPlayer: License key is required but not provided. Please set the licenseKey prop to use the player."
|
|
1862
|
+
);
|
|
1863
|
+
return;
|
|
1864
|
+
}
|
|
1865
|
+
setShowLicenseWarning(false);
|
|
1867
1866
|
if (playerRef.current) {
|
|
1868
1867
|
try {
|
|
1869
1868
|
playerRef.current.destroy();
|
|
@@ -2187,7 +2186,60 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(
|
|
|
2187
2186
|
)
|
|
2188
2187
|
}
|
|
2189
2188
|
),
|
|
2190
|
-
|
|
2189
|
+
showLicenseWarning && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
2190
|
+
"div",
|
|
2191
|
+
{
|
|
2192
|
+
style: {
|
|
2193
|
+
position: "absolute",
|
|
2194
|
+
top: "50%",
|
|
2195
|
+
left: "50%",
|
|
2196
|
+
transform: "translate(-50%, -50%)",
|
|
2197
|
+
zIndex: 25,
|
|
2198
|
+
background: "linear-gradient(135deg, rgba(220, 38, 38, 0.95) 0%, rgba(185, 28, 28, 0.9) 100%)",
|
|
2199
|
+
color: "white",
|
|
2200
|
+
padding: "24px 32px",
|
|
2201
|
+
borderRadius: "16px",
|
|
2202
|
+
backdropFilter: "blur(20px)",
|
|
2203
|
+
border: "2px solid rgba(255, 255, 255, 0.2)",
|
|
2204
|
+
boxShadow: "0 20px 60px rgba(0, 0, 0, 0.6), inset 0 2px 0 rgba(255, 255, 255, 0.2)",
|
|
2205
|
+
textAlign: "center",
|
|
2206
|
+
maxWidth: "400px",
|
|
2207
|
+
margin: "0 16px"
|
|
2208
|
+
},
|
|
2209
|
+
children: [
|
|
2210
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
2211
|
+
"div",
|
|
2212
|
+
{
|
|
2213
|
+
style: {
|
|
2214
|
+
fontSize: "20px",
|
|
2215
|
+
fontWeight: "bold",
|
|
2216
|
+
marginBottom: "12px",
|
|
2217
|
+
color: "#ffffff",
|
|
2218
|
+
textShadow: "0 2px 4px rgba(0, 0, 0, 0.5)"
|
|
2219
|
+
},
|
|
2220
|
+
children: "License Key Required"
|
|
2221
|
+
}
|
|
2222
|
+
),
|
|
2223
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
2224
|
+
"div",
|
|
2225
|
+
{
|
|
2226
|
+
style: {
|
|
2227
|
+
fontSize: "14px",
|
|
2228
|
+
lineHeight: "1.5",
|
|
2229
|
+
color: "rgba(255, 255, 255, 0.9)",
|
|
2230
|
+
textShadow: "0 1px 2px rgba(0, 0, 0, 0.3)"
|
|
2231
|
+
},
|
|
2232
|
+
children: [
|
|
2233
|
+
"Please provide a valid license key to use the Stormcloud Video Player.",
|
|
2234
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("br", {}),
|
|
2235
|
+
"Contact your administrator for licensing information."
|
|
2236
|
+
]
|
|
2237
|
+
}
|
|
2238
|
+
)
|
|
2239
|
+
]
|
|
2240
|
+
}
|
|
2241
|
+
),
|
|
2242
|
+
showCenterPlay && !isLoading && !isBuffering && !showLicenseWarning && !adStatus.showAds && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
2191
2243
|
"div",
|
|
2192
2244
|
{
|
|
2193
2245
|
onClick: handleCenterPlayClick,
|
|
@@ -2238,7 +2290,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(
|
|
|
2238
2290
|
)
|
|
2239
2291
|
}
|
|
2240
2292
|
),
|
|
2241
|
-
shouldShowEnhancedControls ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
2293
|
+
shouldShowEnhancedControls && !showLicenseWarning ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
2242
2294
|
"div",
|
|
2243
2295
|
{
|
|
2244
2296
|
style: {
|
|
@@ -2703,7 +2755,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(
|
|
|
2703
2755
|
)
|
|
2704
2756
|
]
|
|
2705
2757
|
}
|
|
2706
|
-
) }) : showCustomControls && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
2758
|
+
) }) : showCustomControls && !showLicenseWarning && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
2707
2759
|
"div",
|
|
2708
2760
|
{
|
|
2709
2761
|
style: {
|