stormcloud-video-player 0.7.32 → 0.7.35

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.
@@ -8,6 +8,7 @@ type StormcloudVideoPlayerProps = Omit<StormcloudVideoPlayerConfig, "videoElemen
8
8
  wrapperStyle?: React.CSSProperties;
9
9
  licenseKey?: string;
10
10
  swirlProjectId?: number;
11
+ swirlShowcaseDemo?: boolean;
11
12
  adcisionChannelId?: number;
12
13
  disableOverlays?: boolean;
13
14
  showAdsControl?: boolean;
@@ -180,6 +180,9 @@ var __toCommonJS = function __toCommonJS(mod) {
180
180
  // src/utils/overlays.ts
181
181
  var overlays_exports = {};
182
182
  __export(overlays_exports, {
183
+ createDemoStockTickerOverlay: function createDemoStockTickerOverlay1() {
184
+ return createDemoStockTickerOverlay;
185
+ },
183
186
  fetchProjectOverlays: function fetchProjectOverlays1() {
184
187
  return fetchProjectOverlays;
185
188
  },
@@ -229,6 +232,42 @@ function isOverlayActive(overlay, currentTime) {
229
232
  if (durationSec <= 0) return false;
230
233
  return currentTime >= startSec && currentTime < startSec + durationSec;
231
234
  }
235
+ function createDemoStockTickerOverlay(projectId) {
236
+ return {
237
+ id: -9001,
238
+ project_id: projectId,
239
+ name: "Demo stock ticker",
240
+ type: "scroller",
241
+ visible: true,
242
+ x: 144,
243
+ y: 950,
244
+ width: 1632,
245
+ height: 97,
246
+ opacity: 100,
247
+ start_time: "00:00:00.000",
248
+ duration: "24:00:00.000",
249
+ z_index: 120,
250
+ scroller_config: {
251
+ use_custom_text: true,
252
+ custom_text: "AAPL +1.24% \u2022 MSFT +0.42% \u2022 GOOGL \u22120.11% \u2022 TSLA +2.31% \u2022 NVDA +1.87% \u2022 AMZN +0.65% \u2022 META +0.38% \u2022 DJIA +0.52% \u2022 S&P 500 +0.33% \u2022 NDAQ +0.41%",
253
+ direction: "left",
254
+ scroll_speed: 42,
255
+ font_size: 15,
256
+ font_weight: "700",
257
+ text_color: "#f8fafc",
258
+ background_color: "#0f172a",
259
+ background_opacity: 92,
260
+ border_radius: 4,
261
+ label: "MARKETS",
262
+ label_line2: "LIVE",
263
+ label_color: "#0ea5e9",
264
+ label_text_color: "#ffffff",
265
+ accent_color: "#38bdf8",
266
+ show_accent_line: true,
267
+ separator_char: "\u2022"
268
+ }
269
+ };
270
+ }
232
271
  function fetchProjectOverlays(_0) {
233
272
  return _async_to_generator(function(projectId) {
234
273
  var apiBaseUrl, response, data;
@@ -278,6 +317,7 @@ function resolveImageUrl(imageUrl) {
278
317
  }
279
318
  // Annotate the CommonJS export names for ESM import in node:
280
319
  0 && (module.exports = {
320
+ createDemoStockTickerOverlay: createDemoStockTickerOverlay,
281
321
  fetchProjectOverlays: fetchProjectOverlays,
282
322
  isOverlayActive: isOverlayActive,
283
323
  resolveImageUrl: resolveImageUrl,
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/ubuntu24-new/Dev/stormcloud-vp/lib/utils/overlays.cjs"],"names":[],"mappings":"AAAA","sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\n\n// src/utils/overlays.ts\nvar overlays_exports = {};\n__export(overlays_exports, {\n fetchProjectOverlays: () => fetchProjectOverlays,\n isOverlayActive: () => isOverlayActive,\n resolveImageUrl: () => resolveImageUrl,\n timeStringToSeconds: () => timeStringToSeconds\n});\nmodule.exports = __toCommonJS(overlays_exports);\nvar OVERLAY_API_BASE = \"https://adstorm.co/api-adstorm-dev\";\nfunction timeStringToSeconds(timeStr) {\n if (!timeStr) return 0;\n const parts = timeStr.split(\":\");\n if (parts.length >= 3) {\n const hours = parseInt(parts[0] ?? \"0\", 10) || 0;\n const minutes = parseInt(parts[1] ?? \"0\", 10) || 0;\n const secStr = parts[2] ?? \"0\";\n const dotIdx = secStr.indexOf(\".\");\n const seconds = parseInt(dotIdx >= 0 ? secStr.substring(0, dotIdx) : secStr, 10) || 0;\n const msFrag = dotIdx >= 0 ? secStr.substring(dotIdx + 1) : \"\";\n const ms = msFrag ? parseInt(msFrag.padEnd(3, \"0\").substring(0, 3), 10) || 0 : 0;\n return hours * 3600 + minutes * 60 + seconds + ms / 1e3;\n }\n if (parts.length === 2) {\n const minutes = parseInt(parts[0] ?? \"0\", 10) || 0;\n const secStr = parts[1] ?? \"0\";\n const dotIdx = secStr.indexOf(\".\");\n const seconds = parseInt(dotIdx >= 0 ? secStr.substring(0, dotIdx) : secStr, 10) || 0;\n const msFrag = dotIdx >= 0 ? secStr.substring(dotIdx + 1) : \"\";\n const ms = msFrag ? parseInt(msFrag.padEnd(3, \"0\").substring(0, 3), 10) || 0 : 0;\n return minutes * 60 + seconds + ms / 1e3;\n }\n const num = parseFloat(timeStr);\n return isFinite(num) ? Math.max(0, num) : 0;\n}\nfunction isOverlayActive(overlay, currentTime) {\n if (!overlay.visible) return false;\n const startSec = timeStringToSeconds(overlay.start_time);\n const durationSec = timeStringToSeconds(overlay.duration);\n if (durationSec <= 0) return false;\n return currentTime >= startSec && currentTime < startSec + durationSec;\n}\nasync function fetchProjectOverlays(projectId, apiBaseUrl = OVERLAY_API_BASE) {\n const response = await fetch(\n `${apiBaseUrl}/adstorm/swirl/projects/${projectId}/overlays`\n );\n if (!response.ok) {\n throw new Error(\n `Failed to fetch overlays: ${response.status} ${response.statusText}`\n );\n }\n const data = await response.json();\n return Array.isArray(data) ? data : [];\n}\nfunction resolveImageUrl(imageUrl, apiBaseUrl = OVERLAY_API_BASE) {\n if (!imageUrl) return \"\";\n if (imageUrl.startsWith(\"http://\") || imageUrl.startsWith(\"https://\")) {\n return imageUrl;\n }\n if (imageUrl.startsWith(\"/\")) {\n try {\n const url = new URL(apiBaseUrl);\n return `${url.origin}${imageUrl}`;\n } catch {\n return imageUrl;\n }\n }\n return `${apiBaseUrl}/${imageUrl}`;\n}\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n fetchProjectOverlays,\n isOverlayActive,\n resolveImageUrl,\n timeStringToSeconds\n});\n"]}
1
+ {"version":3,"sources":["/home/ubuntu24-new/Dev/stormcloud-vp/lib/utils/overlays.cjs"],"names":[],"mappings":"AAAA","sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\n\n// src/utils/overlays.ts\nvar overlays_exports = {};\n__export(overlays_exports, {\n createDemoStockTickerOverlay: () => createDemoStockTickerOverlay,\n fetchProjectOverlays: () => fetchProjectOverlays,\n isOverlayActive: () => isOverlayActive,\n resolveImageUrl: () => resolveImageUrl,\n timeStringToSeconds: () => timeStringToSeconds\n});\nmodule.exports = __toCommonJS(overlays_exports);\nvar OVERLAY_API_BASE = \"https://adstorm.co/api-adstorm-dev\";\nfunction timeStringToSeconds(timeStr) {\n if (!timeStr) return 0;\n const parts = timeStr.split(\":\");\n if (parts.length >= 3) {\n const hours = parseInt(parts[0] ?? \"0\", 10) || 0;\n const minutes = parseInt(parts[1] ?? \"0\", 10) || 0;\n const secStr = parts[2] ?? \"0\";\n const dotIdx = secStr.indexOf(\".\");\n const seconds = parseInt(dotIdx >= 0 ? secStr.substring(0, dotIdx) : secStr, 10) || 0;\n const msFrag = dotIdx >= 0 ? secStr.substring(dotIdx + 1) : \"\";\n const ms = msFrag ? parseInt(msFrag.padEnd(3, \"0\").substring(0, 3), 10) || 0 : 0;\n return hours * 3600 + minutes * 60 + seconds + ms / 1e3;\n }\n if (parts.length === 2) {\n const minutes = parseInt(parts[0] ?? \"0\", 10) || 0;\n const secStr = parts[1] ?? \"0\";\n const dotIdx = secStr.indexOf(\".\");\n const seconds = parseInt(dotIdx >= 0 ? secStr.substring(0, dotIdx) : secStr, 10) || 0;\n const msFrag = dotIdx >= 0 ? secStr.substring(dotIdx + 1) : \"\";\n const ms = msFrag ? parseInt(msFrag.padEnd(3, \"0\").substring(0, 3), 10) || 0 : 0;\n return minutes * 60 + seconds + ms / 1e3;\n }\n const num = parseFloat(timeStr);\n return isFinite(num) ? Math.max(0, num) : 0;\n}\nfunction isOverlayActive(overlay, currentTime) {\n if (!overlay.visible) return false;\n const startSec = timeStringToSeconds(overlay.start_time);\n const durationSec = timeStringToSeconds(overlay.duration);\n if (durationSec <= 0) return false;\n return currentTime >= startSec && currentTime < startSec + durationSec;\n}\nfunction createDemoStockTickerOverlay(projectId) {\n return {\n id: -9001,\n project_id: projectId,\n name: \"Demo stock ticker\",\n type: \"scroller\",\n visible: true,\n x: 144,\n y: 950,\n width: 1632,\n height: 97,\n opacity: 100,\n start_time: \"00:00:00.000\",\n duration: \"24:00:00.000\",\n z_index: 120,\n scroller_config: {\n use_custom_text: true,\n custom_text: \"AAPL +1.24% \\u2022 MSFT +0.42% \\u2022 GOOGL \\u22120.11% \\u2022 TSLA +2.31% \\u2022 NVDA +1.87% \\u2022 AMZN +0.65% \\u2022 META +0.38% \\u2022 DJIA +0.52% \\u2022 S&P 500 +0.33% \\u2022 NDAQ +0.41%\",\n direction: \"left\",\n scroll_speed: 42,\n font_size: 15,\n font_weight: \"700\",\n text_color: \"#f8fafc\",\n background_color: \"#0f172a\",\n background_opacity: 92,\n border_radius: 4,\n label: \"MARKETS\",\n label_line2: \"LIVE\",\n label_color: \"#0ea5e9\",\n label_text_color: \"#ffffff\",\n accent_color: \"#38bdf8\",\n show_accent_line: true,\n separator_char: \"\\u2022\"\n }\n };\n}\nasync function fetchProjectOverlays(projectId, apiBaseUrl = OVERLAY_API_BASE) {\n const response = await fetch(\n `${apiBaseUrl}/adstorm/swirl/projects/${projectId}/overlays`\n );\n if (!response.ok) {\n throw new Error(\n `Failed to fetch overlays: ${response.status} ${response.statusText}`\n );\n }\n const data = await response.json();\n return Array.isArray(data) ? data : [];\n}\nfunction resolveImageUrl(imageUrl, apiBaseUrl = OVERLAY_API_BASE) {\n if (!imageUrl) return \"\";\n if (imageUrl.startsWith(\"http://\") || imageUrl.startsWith(\"https://\")) {\n return imageUrl;\n }\n if (imageUrl.startsWith(\"/\")) {\n try {\n const url = new URL(apiBaseUrl);\n return `${url.origin}${imageUrl}`;\n } catch {\n return imageUrl;\n }\n }\n return `${apiBaseUrl}/${imageUrl}`;\n}\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n createDemoStockTickerOverlay,\n fetchProjectOverlays,\n isOverlayActive,\n resolveImageUrl,\n timeStringToSeconds\n});\n"]}
@@ -62,7 +62,8 @@ interface SwirlOverlay {
62
62
  }
63
63
  declare function timeStringToSeconds(timeStr: string): number;
64
64
  declare function isOverlayActive(overlay: SwirlOverlay, currentTime: number): boolean;
65
+ declare function createDemoStockTickerOverlay(projectId: number): SwirlOverlay;
65
66
  declare function fetchProjectOverlays(projectId: number, apiBaseUrl?: string): Promise<SwirlOverlay[]>;
66
67
  declare function resolveImageUrl(imageUrl: string, apiBaseUrl?: string): string;
67
68
 
68
- export { type OverlayCoordinateSpace, type SwirlOverlay, type SwirlOverlayType, type SwirlScrollerConfig, fetchProjectOverlays, isOverlayActive, resolveImageUrl, timeStringToSeconds };
69
+ export { type OverlayCoordinateSpace, type SwirlOverlay, type SwirlOverlayType, type SwirlScrollerConfig, createDemoStockTickerOverlay, fetchProjectOverlays, isOverlayActive, resolveImageUrl, timeStringToSeconds };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stormcloud-video-player",
3
- "version": "0.7.32",
3
+ "version": "0.7.35",
4
4
  "main": "lib/index.js",
5
5
  "typings": "lib/index.d.ts",
6
6
  "scripts": {