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
package/lib/index.d.cts
CHANGED
|
@@ -116,7 +116,6 @@ declare class StormcloudVideoPlayer {
|
|
|
116
116
|
getStreamType(): "hls" | "other";
|
|
117
117
|
shouldShowNativeControls(): boolean;
|
|
118
118
|
private shouldContinueLiveStreamDuringAds;
|
|
119
|
-
loadDefaultVastFromAdstorm(adstormApiUrl: string, params?: Record<string, string>): Promise<void>;
|
|
120
119
|
private handleAdStart;
|
|
121
120
|
private findCurrentOrNextBreak;
|
|
122
121
|
private onTimeUpdate;
|
package/lib/index.d.ts
CHANGED
|
@@ -116,7 +116,6 @@ declare class StormcloudVideoPlayer {
|
|
|
116
116
|
getStreamType(): "hls" | "other";
|
|
117
117
|
shouldShowNativeControls(): boolean;
|
|
118
118
|
private shouldContinueLiveStreamDuringAds;
|
|
119
|
-
loadDefaultVastFromAdstorm(adstormApiUrl: string, params?: Record<string, string>): Promise<void>;
|
|
120
119
|
private handleAdStart;
|
|
121
120
|
private findCurrentOrNextBreak;
|
|
122
121
|
private onTimeUpdate;
|
package/lib/index.js
CHANGED
|
@@ -1371,17 +1371,6 @@ var StormcloudVideoPlayer = class {
|
|
|
1371
1371
|
}
|
|
1372
1372
|
return true;
|
|
1373
1373
|
}
|
|
1374
|
-
async loadDefaultVastFromAdstorm(adstormApiUrl, params) {
|
|
1375
|
-
const usp = new URLSearchParams(params || {});
|
|
1376
|
-
const url = `${adstormApiUrl}?${usp.toString()}`;
|
|
1377
|
-
const res = await fetch(url);
|
|
1378
|
-
if (!res.ok) throw new Error(`Failed to fetch adstorm ads: ${res.status}`);
|
|
1379
|
-
const data = await res.json();
|
|
1380
|
-
const tag = data?.adTagUrl || data?.vastTagUrl || data?.tagUrl;
|
|
1381
|
-
if (typeof tag === "string" && tag.length > 0) {
|
|
1382
|
-
this.apiVastTagUrl = tag;
|
|
1383
|
-
}
|
|
1384
|
-
}
|
|
1385
1374
|
async handleAdStart(_marker) {
|
|
1386
1375
|
const scheduled = this.findCurrentOrNextBreak(
|
|
1387
1376
|
this.video.currentTime * 1e3
|
|
@@ -1782,6 +1771,7 @@ var StormcloudVideoPlayerComponent = React.memo(
|
|
|
1782
1771
|
const [isLoading, setIsLoading] = React.useState(true);
|
|
1783
1772
|
const [isBuffering, setIsBuffering] = React.useState(false);
|
|
1784
1773
|
const [showCenterPlay, setShowCenterPlay] = React.useState(false);
|
|
1774
|
+
const [showLicenseWarning, setShowLicenseWarning] = React.useState(false);
|
|
1785
1775
|
const formatTime = (seconds) => {
|
|
1786
1776
|
if (!isFinite(seconds)) return "0:00:00";
|
|
1787
1777
|
const hours = Math.floor(seconds / 3600);
|
|
@@ -1839,6 +1829,15 @@ var StormcloudVideoPlayerComponent = React.memo(
|
|
|
1839
1829
|
if (typeof window === "undefined") return;
|
|
1840
1830
|
const el = videoRef.current;
|
|
1841
1831
|
if (!el || !src) return;
|
|
1832
|
+
if (!licenseKey) {
|
|
1833
|
+
setShowLicenseWarning(true);
|
|
1834
|
+
setIsLoading(false);
|
|
1835
|
+
console.warn(
|
|
1836
|
+
"StormcloudVideoPlayer: License key is required but not provided. Please set the licenseKey prop to use the player."
|
|
1837
|
+
);
|
|
1838
|
+
return;
|
|
1839
|
+
}
|
|
1840
|
+
setShowLicenseWarning(false);
|
|
1842
1841
|
if (playerRef.current) {
|
|
1843
1842
|
try {
|
|
1844
1843
|
playerRef.current.destroy();
|
|
@@ -2162,7 +2161,60 @@ var StormcloudVideoPlayerComponent = React.memo(
|
|
|
2162
2161
|
)
|
|
2163
2162
|
}
|
|
2164
2163
|
),
|
|
2165
|
-
|
|
2164
|
+
showLicenseWarning && /* @__PURE__ */ jsxs(
|
|
2165
|
+
"div",
|
|
2166
|
+
{
|
|
2167
|
+
style: {
|
|
2168
|
+
position: "absolute",
|
|
2169
|
+
top: "50%",
|
|
2170
|
+
left: "50%",
|
|
2171
|
+
transform: "translate(-50%, -50%)",
|
|
2172
|
+
zIndex: 25,
|
|
2173
|
+
background: "linear-gradient(135deg, rgba(220, 38, 38, 0.95) 0%, rgba(185, 28, 28, 0.9) 100%)",
|
|
2174
|
+
color: "white",
|
|
2175
|
+
padding: "24px 32px",
|
|
2176
|
+
borderRadius: "16px",
|
|
2177
|
+
backdropFilter: "blur(20px)",
|
|
2178
|
+
border: "2px solid rgba(255, 255, 255, 0.2)",
|
|
2179
|
+
boxShadow: "0 20px 60px rgba(0, 0, 0, 0.6), inset 0 2px 0 rgba(255, 255, 255, 0.2)",
|
|
2180
|
+
textAlign: "center",
|
|
2181
|
+
maxWidth: "400px",
|
|
2182
|
+
margin: "0 16px"
|
|
2183
|
+
},
|
|
2184
|
+
children: [
|
|
2185
|
+
/* @__PURE__ */ jsx(
|
|
2186
|
+
"div",
|
|
2187
|
+
{
|
|
2188
|
+
style: {
|
|
2189
|
+
fontSize: "20px",
|
|
2190
|
+
fontWeight: "bold",
|
|
2191
|
+
marginBottom: "12px",
|
|
2192
|
+
color: "#ffffff",
|
|
2193
|
+
textShadow: "0 2px 4px rgba(0, 0, 0, 0.5)"
|
|
2194
|
+
},
|
|
2195
|
+
children: "License Key Required"
|
|
2196
|
+
}
|
|
2197
|
+
),
|
|
2198
|
+
/* @__PURE__ */ jsxs(
|
|
2199
|
+
"div",
|
|
2200
|
+
{
|
|
2201
|
+
style: {
|
|
2202
|
+
fontSize: "14px",
|
|
2203
|
+
lineHeight: "1.5",
|
|
2204
|
+
color: "rgba(255, 255, 255, 0.9)",
|
|
2205
|
+
textShadow: "0 1px 2px rgba(0, 0, 0, 0.3)"
|
|
2206
|
+
},
|
|
2207
|
+
children: [
|
|
2208
|
+
"Please provide a valid license key to use the Stormcloud Video Player.",
|
|
2209
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
2210
|
+
"Contact your administrator for licensing information."
|
|
2211
|
+
]
|
|
2212
|
+
}
|
|
2213
|
+
)
|
|
2214
|
+
]
|
|
2215
|
+
}
|
|
2216
|
+
),
|
|
2217
|
+
showCenterPlay && !isLoading && !isBuffering && !showLicenseWarning && !adStatus.showAds && /* @__PURE__ */ jsx(
|
|
2166
2218
|
"div",
|
|
2167
2219
|
{
|
|
2168
2220
|
onClick: handleCenterPlayClick,
|
|
@@ -2213,7 +2265,7 @@ var StormcloudVideoPlayerComponent = React.memo(
|
|
|
2213
2265
|
)
|
|
2214
2266
|
}
|
|
2215
2267
|
),
|
|
2216
|
-
shouldShowEnhancedControls ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
|
|
2268
|
+
shouldShowEnhancedControls && !showLicenseWarning ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
|
|
2217
2269
|
"div",
|
|
2218
2270
|
{
|
|
2219
2271
|
style: {
|
|
@@ -2678,7 +2730,7 @@ var StormcloudVideoPlayerComponent = React.memo(
|
|
|
2678
2730
|
)
|
|
2679
2731
|
]
|
|
2680
2732
|
}
|
|
2681
|
-
) }) : showCustomControls && /* @__PURE__ */ jsxs(
|
|
2733
|
+
) }) : showCustomControls && !showLicenseWarning && /* @__PURE__ */ jsxs(
|
|
2682
2734
|
"div",
|
|
2683
2735
|
{
|
|
2684
2736
|
style: {
|