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/lib/index.cjs CHANGED
@@ -1430,17 +1430,6 @@ var StormcloudVideoPlayer = class {
1430
1430
  }
1431
1431
  return true;
1432
1432
  }
1433
- async loadDefaultVastFromAdstorm(adstormApiUrl, params) {
1434
- const usp = new URLSearchParams(params || {});
1435
- const url = `${adstormApiUrl}?${usp.toString()}`;
1436
- const res = await fetch(url);
1437
- if (!res.ok) throw new Error(`Failed to fetch adstorm ads: ${res.status}`);
1438
- const data = await res.json();
1439
- const tag = data?.adTagUrl || data?.vastTagUrl || data?.tagUrl;
1440
- if (typeof tag === "string" && tag.length > 0) {
1441
- this.apiVastTagUrl = tag;
1442
- }
1443
- }
1444
1433
  async handleAdStart(_marker) {
1445
1434
  const scheduled = this.findCurrentOrNextBreak(
1446
1435
  this.video.currentTime * 1e3
@@ -1832,6 +1821,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(
1832
1821
  const [isLoading, setIsLoading] = import_react.default.useState(true);
1833
1822
  const [isBuffering, setIsBuffering] = import_react.default.useState(false);
1834
1823
  const [showCenterPlay, setShowCenterPlay] = import_react.default.useState(false);
1824
+ const [showLicenseWarning, setShowLicenseWarning] = import_react.default.useState(false);
1835
1825
  const formatTime = (seconds) => {
1836
1826
  if (!isFinite(seconds)) return "0:00:00";
1837
1827
  const hours = Math.floor(seconds / 3600);
@@ -1889,6 +1879,15 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(
1889
1879
  if (typeof window === "undefined") return;
1890
1880
  const el = videoRef.current;
1891
1881
  if (!el || !src) return;
1882
+ if (!licenseKey) {
1883
+ setShowLicenseWarning(true);
1884
+ setIsLoading(false);
1885
+ console.warn(
1886
+ "StormcloudVideoPlayer: License key is required but not provided. Please set the licenseKey prop to use the player."
1887
+ );
1888
+ return;
1889
+ }
1890
+ setShowLicenseWarning(false);
1892
1891
  if (playerRef.current) {
1893
1892
  try {
1894
1893
  playerRef.current.destroy();
@@ -2212,7 +2211,60 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(
2212
2211
  )
2213
2212
  }
2214
2213
  ),
2215
- showCenterPlay && !isLoading && !isBuffering && !adStatus.showAds && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
2214
+ showLicenseWarning && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
2215
+ "div",
2216
+ {
2217
+ style: {
2218
+ position: "absolute",
2219
+ top: "50%",
2220
+ left: "50%",
2221
+ transform: "translate(-50%, -50%)",
2222
+ zIndex: 25,
2223
+ background: "linear-gradient(135deg, rgba(220, 38, 38, 0.95) 0%, rgba(185, 28, 28, 0.9) 100%)",
2224
+ color: "white",
2225
+ padding: "24px 32px",
2226
+ borderRadius: "16px",
2227
+ backdropFilter: "blur(20px)",
2228
+ border: "2px solid rgba(255, 255, 255, 0.2)",
2229
+ boxShadow: "0 20px 60px rgba(0, 0, 0, 0.6), inset 0 2px 0 rgba(255, 255, 255, 0.2)",
2230
+ textAlign: "center",
2231
+ maxWidth: "400px",
2232
+ margin: "0 16px"
2233
+ },
2234
+ children: [
2235
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
2236
+ "div",
2237
+ {
2238
+ style: {
2239
+ fontSize: "20px",
2240
+ fontWeight: "bold",
2241
+ marginBottom: "12px",
2242
+ color: "#ffffff",
2243
+ textShadow: "0 2px 4px rgba(0, 0, 0, 0.5)"
2244
+ },
2245
+ children: "License Key Required"
2246
+ }
2247
+ ),
2248
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
2249
+ "div",
2250
+ {
2251
+ style: {
2252
+ fontSize: "14px",
2253
+ lineHeight: "1.5",
2254
+ color: "rgba(255, 255, 255, 0.9)",
2255
+ textShadow: "0 1px 2px rgba(0, 0, 0, 0.3)"
2256
+ },
2257
+ children: [
2258
+ "Please provide a valid license key to use the Stormcloud Video Player.",
2259
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("br", {}),
2260
+ "Contact your administrator for licensing information."
2261
+ ]
2262
+ }
2263
+ )
2264
+ ]
2265
+ }
2266
+ ),
2267
+ showCenterPlay && !isLoading && !isBuffering && !showLicenseWarning && !adStatus.showAds && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
2216
2268
  "div",
2217
2269
  {
2218
2270
  onClick: handleCenterPlayClick,
@@ -2263,7 +2315,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(
2263
2315
  )
2264
2316
  }
2265
2317
  ),
2266
- shouldShowEnhancedControls ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
2318
+ shouldShowEnhancedControls && !showLicenseWarning ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
2267
2319
  "div",
2268
2320
  {
2269
2321
  style: {
@@ -2728,7 +2780,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(
2728
2780
  )
2729
2781
  ]
2730
2782
  }
2731
- ) }) : showCustomControls && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
2783
+ ) }) : showCustomControls && !showLicenseWarning && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
2732
2784
  "div",
2733
2785
  {
2734
2786
  style: {