stormcloud-video-player 0.7.40 → 0.7.42
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 +24 -109
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +1 -8
- package/lib/index.d.ts +1 -8
- package/lib/index.js +25 -102
- package/lib/index.js.map +1 -1
- package/lib/ui/OverlayRenderer.cjs +23 -20
- package/lib/ui/OverlayRenderer.cjs.map +1 -1
- package/lib/ui/StormcloudVideoPlayer.cjs +24 -101
- package/lib/ui/StormcloudVideoPlayer.cjs.map +1 -1
- package/lib/utils/overlays.cjs +1 -67
- package/lib/utils/overlays.cjs.map +1 -1
- package/lib/utils/overlays.d.cts +1 -8
- package/package.json +1 -1
|
@@ -5710,8 +5710,7 @@ function overlayAuthoringDimensions(overlay, decodeWidth, decodeHeight) {
|
|
|
5710
5710
|
var EPS = 2;
|
|
5711
5711
|
var exceedsDecode = extR > decodeWidth + EPS || extB > decodeHeight + EPS;
|
|
5712
5712
|
var isNabDemo = overlay.name.startsWith(NAB_DEMO_NAME_PREFIX);
|
|
5713
|
-
|
|
5714
|
-
if (exceedsDecode && (isNabDemo || isSyntheticMarketsTicker)) {
|
|
5713
|
+
if (exceedsDecode && isNabDemo) {
|
|
5715
5714
|
return {
|
|
5716
5715
|
width: SWIRL_HD_AUTHORING_WIDTH,
|
|
5717
5716
|
height: SWIRL_HD_AUTHORING_HEIGHT
|
|
@@ -5809,63 +5808,6 @@ function inferSwirlOverlayCoordinateSpace(overlays, videoWidth, videoHeight) {
|
|
|
5809
5808
|
height: videoHeight
|
|
5810
5809
|
};
|
|
5811
5810
|
}
|
|
5812
|
-
function scrollerLooksLikeMarketsStock(o) {
|
|
5813
|
-
var _ref, _ref1, _ref2, _ref3;
|
|
5814
|
-
if (o.type !== "scroller") return false;
|
|
5815
|
-
var cfg = o.scroller_config;
|
|
5816
|
-
var blob = "".concat(o.name, " ").concat((_ref = cfg === null || cfg === void 0 ? void 0 : cfg.label) !== null && _ref !== void 0 ? _ref : "", " ").concat((_ref1 = cfg === null || cfg === void 0 ? void 0 : cfg.label_line2) !== null && _ref1 !== void 0 ? _ref1 : "", " ").concat((_ref2 = cfg === null || cfg === void 0 ? void 0 : cfg.custom_text) !== null && _ref2 !== void 0 ? _ref2 : "", " ").concat((_ref3 = cfg === null || cfg === void 0 ? void 0 : cfg.preset) !== null && _ref3 !== void 0 ? _ref3 : "");
|
|
5817
|
-
return /\b(MARKETS?|NYSE|NASDAQ|DJIA|\bS&P\b|STOCK|AAPL|TSLA|NVDA|EQUITIES)\b/i.test(blob);
|
|
5818
|
-
}
|
|
5819
|
-
function createDemoStockTickerOverlay(projectId, opts) {
|
|
5820
|
-
var stack = (opts === null || opts === void 0 ? void 0 : opts.stackAboveNews) === true;
|
|
5821
|
-
var cw = (opts === null || opts === void 0 ? void 0 : opts.coordinateWidth) && opts.coordinateWidth > 0 ? opts.coordinateWidth : SWIRL_HD_AUTHORING_WIDTH;
|
|
5822
|
-
var ch = (opts === null || opts === void 0 ? void 0 : opts.coordinateHeight) && opts.coordinateHeight > 0 ? opts.coordinateHeight : SWIRL_HD_AUTHORING_HEIGHT;
|
|
5823
|
-
var sx = cw / SWIRL_HD_AUTHORING_WIDTH;
|
|
5824
|
-
var sy = ch / SWIRL_HD_AUTHORING_HEIGHT;
|
|
5825
|
-
var x = 36 * sx;
|
|
5826
|
-
var y = (stack ? 788 : 992) * sy;
|
|
5827
|
-
var width = 1848 * sx;
|
|
5828
|
-
var height = (stack ? 72 : 78) * sy;
|
|
5829
|
-
var fontSize = Math.max(8, Math.round(14 * sy));
|
|
5830
|
-
var scrollSpeed = Math.max(8, Math.round(38 * sx));
|
|
5831
|
-
var borderRadius = Math.max(1, Math.round(6 * sy));
|
|
5832
|
-
return {
|
|
5833
|
-
id: -9001,
|
|
5834
|
-
project_id: projectId,
|
|
5835
|
-
name: "Demo stock ticker",
|
|
5836
|
-
type: "scroller",
|
|
5837
|
-
visible: true,
|
|
5838
|
-
x: x,
|
|
5839
|
-
y: y,
|
|
5840
|
-
width: width,
|
|
5841
|
-
height: height,
|
|
5842
|
-
opacity: 100,
|
|
5843
|
-
start_time: "00:00:00.000",
|
|
5844
|
-
duration: "24:00:00.000",
|
|
5845
|
-
z_index: stack ? 125 : 120,
|
|
5846
|
-
scroller_config: {
|
|
5847
|
-
use_custom_text: true,
|
|
5848
|
-
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%",
|
|
5849
|
-
direction: "left",
|
|
5850
|
-
scroll_speed: scrollSpeed,
|
|
5851
|
-
font_size: fontSize,
|
|
5852
|
-
font_weight: "600",
|
|
5853
|
-
text_color: "#e2e8f0",
|
|
5854
|
-
background_color: "#070b14",
|
|
5855
|
-
background_opacity: 94,
|
|
5856
|
-
border_radius: borderRadius,
|
|
5857
|
-
padding: Math.max(4, Math.round(8 * sy)),
|
|
5858
|
-
label: "MARKETS",
|
|
5859
|
-
label_line2: "LIVE",
|
|
5860
|
-
label_color: "#0e7490",
|
|
5861
|
-
label_text_color: "#ecfeff",
|
|
5862
|
-
accent_color: "#22d3ee",
|
|
5863
|
-
show_accent_line: true,
|
|
5864
|
-
separator_char: "\u2022",
|
|
5865
|
-
item_spacing: Math.max(32, Math.round(56 * sx))
|
|
5866
|
-
}
|
|
5867
|
-
};
|
|
5868
|
-
}
|
|
5869
5811
|
function normalizeScrollerConfig(raw) {
|
|
5870
5812
|
if (!raw || (typeof raw === "undefined" ? "undefined" : _type_of(raw)) !== "object") return void 0;
|
|
5871
5813
|
var r = raw;
|
|
@@ -6312,6 +6254,7 @@ function ScrollerOverlay(param) {
|
|
|
6312
6254
|
var labelTextColor = (_ref11 = cfg === null || cfg === void 0 ? void 0 : cfg.label_text_color) !== null && _ref11 !== void 0 ? _ref11 : "#ffffff";
|
|
6313
6255
|
var accentColor = (_ref12 = cfg === null || cfg === void 0 ? void 0 : cfg.accent_color) !== null && _ref12 !== void 0 ? _ref12 : labelColor;
|
|
6314
6256
|
var showAccentLine = (cfg === null || cfg === void 0 ? void 0 : cfg.show_accent_line) !== false;
|
|
6257
|
+
var isEquitiesStrip = (cfg === null || cfg === void 0 ? void 0 : cfg.preset) === "equities_strip";
|
|
6315
6258
|
var isHorizontal = direction === "left" || direction === "right";
|
|
6316
6259
|
var isReverse = direction === "right" || direction === "down";
|
|
6317
6260
|
var fullText = segments.join(" ".concat(sep, " "));
|
|
@@ -6342,7 +6285,7 @@ function ScrollerOverlay(param) {
|
|
|
6342
6285
|
children: [
|
|
6343
6286
|
showAccentLine && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
6344
6287
|
style: {
|
|
6345
|
-
height: 3,
|
|
6288
|
+
height: isEquitiesStrip ? 2 : 3,
|
|
6346
6289
|
background: accentColor,
|
|
6347
6290
|
flexShrink: 0,
|
|
6348
6291
|
width: "100%"
|
|
@@ -6355,8 +6298,8 @@ function ScrollerOverlay(param) {
|
|
|
6355
6298
|
overflow: "hidden",
|
|
6356
6299
|
minHeight: 0,
|
|
6357
6300
|
alignItems: "center",
|
|
6358
|
-
padding: "".concat(Math.max(4, pad * 0.75), "px ").concat(pad, "px"),
|
|
6359
|
-
gap: Math.max(6, pad),
|
|
6301
|
+
padding: isEquitiesStrip ? "".concat(Math.max(2, pad * 0.5), "px ").concat(pad, "px") : "".concat(Math.max(4, pad * 0.75), "px ").concat(pad, "px"),
|
|
6302
|
+
gap: isEquitiesStrip ? Math.max(4, Math.round(pad * 0.75)) : Math.max(6, pad),
|
|
6360
6303
|
boxSizing: "border-box"
|
|
6361
6304
|
},
|
|
6362
6305
|
children: [
|
|
@@ -6364,30 +6307,33 @@ function ScrollerOverlay(param) {
|
|
|
6364
6307
|
style: {
|
|
6365
6308
|
background: labelColor,
|
|
6366
6309
|
color: labelTextColor,
|
|
6367
|
-
padding: "10px 14px",
|
|
6310
|
+
padding: isEquitiesStrip ? "6px 12px" : "10px 14px",
|
|
6368
6311
|
display: "flex",
|
|
6369
|
-
flexDirection: "column",
|
|
6312
|
+
flexDirection: isEquitiesStrip ? "row" : "column",
|
|
6370
6313
|
alignItems: "center",
|
|
6371
6314
|
justifyContent: "center",
|
|
6372
6315
|
flexShrink: 0,
|
|
6373
6316
|
textAlign: "center",
|
|
6374
|
-
gap: 2,
|
|
6375
|
-
borderRadius: Math.max(
|
|
6376
|
-
boxShadow: "0 2px 8px rgba(0,0,0,0.35)"
|
|
6317
|
+
gap: isEquitiesStrip ? 0 : 2,
|
|
6318
|
+
borderRadius: Math.max(2, borderRadius > 0 ? borderRadius : 6),
|
|
6319
|
+
boxShadow: isEquitiesStrip ? "inset 0 1px 0 rgba(255,255,255,0.08)" : "0 2px 8px rgba(0,0,0,0.35)",
|
|
6320
|
+
alignSelf: "stretch",
|
|
6321
|
+
maxWidth: isEquitiesStrip ? "min(200px, 28%)" : void 0
|
|
6377
6322
|
},
|
|
6378
6323
|
children: [
|
|
6379
6324
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
6380
6325
|
style: {
|
|
6381
|
-
fontWeight: 800,
|
|
6382
|
-
fontSize: "0.78em",
|
|
6383
|
-
letterSpacing: "0.08em",
|
|
6384
|
-
lineHeight: 1.
|
|
6385
|
-
textTransform: "uppercase",
|
|
6386
|
-
whiteSpace: "nowrap"
|
|
6326
|
+
fontWeight: isEquitiesStrip ? 700 : 800,
|
|
6327
|
+
fontSize: isEquitiesStrip ? "0.82em" : "0.78em",
|
|
6328
|
+
letterSpacing: isEquitiesStrip ? "0.04em" : "0.08em",
|
|
6329
|
+
lineHeight: 1.2,
|
|
6330
|
+
textTransform: isEquitiesStrip ? "none" : "uppercase",
|
|
6331
|
+
whiteSpace: isEquitiesStrip ? "normal" : "nowrap",
|
|
6332
|
+
textAlign: isEquitiesStrip ? "left" : "center"
|
|
6387
6333
|
},
|
|
6388
6334
|
children: label
|
|
6389
6335
|
}),
|
|
6390
|
-
labelLine2 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
6336
|
+
labelLine2 && !isEquitiesStrip && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
6391
6337
|
style: {
|
|
6392
6338
|
fontWeight: 600,
|
|
6393
6339
|
fontSize: "0.58em",
|
|
@@ -6402,13 +6348,13 @@ function ScrollerOverlay(param) {
|
|
|
6402
6348
|
}),
|
|
6403
6349
|
label && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
6404
6350
|
style: {
|
|
6405
|
-
width: 2,
|
|
6351
|
+
width: isEquitiesStrip ? 1 : 2,
|
|
6406
6352
|
alignSelf: "stretch",
|
|
6407
|
-
minHeight: 24,
|
|
6353
|
+
minHeight: isEquitiesStrip ? 20 : 24,
|
|
6408
6354
|
background: accentColor,
|
|
6409
6355
|
flexShrink: 0,
|
|
6410
6356
|
borderRadius: 1,
|
|
6411
|
-
opacity: 0.
|
|
6357
|
+
opacity: 0.85
|
|
6412
6358
|
}
|
|
6413
6359
|
}),
|
|
6414
6360
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
@@ -7882,30 +7828,7 @@ var StormcloudVideoPlayerComponent = import_react2.default.memo(function(props)
|
|
|
7882
7828
|
swirlOverlayApiBaseUrl
|
|
7883
7829
|
]);
|
|
7884
7830
|
var _import_react2_default_useState17 = _sliced_to_array(import_react2.default.useState(null), 2), overlayCoordSpace = _import_react2_default_useState17[0], setOverlayCoordSpace = _import_react2_default_useState17[1];
|
|
7885
|
-
var displayOverlays =
|
|
7886
|
-
if (!swirlProjectId || !swirlShowcaseDemo) return overlays;
|
|
7887
|
-
if (overlays.some(scrollerLooksLikeMarketsStock)) return overlays;
|
|
7888
|
-
var hasOtherScroller = overlays.some(function(o) {
|
|
7889
|
-
return o.type === "scroller";
|
|
7890
|
-
});
|
|
7891
|
-
var cw = overlayCoordSpace === null || overlayCoordSpace === void 0 ? void 0 : overlayCoordSpace.width;
|
|
7892
|
-
var ch = overlayCoordSpace === null || overlayCoordSpace === void 0 ? void 0 : overlayCoordSpace.height;
|
|
7893
|
-
var tickerOpts = cw && cw > 0 && ch && ch > 0 ? {
|
|
7894
|
-
stackAboveNews: hasOtherScroller,
|
|
7895
|
-
coordinateWidth: cw,
|
|
7896
|
-
coordinateHeight: ch
|
|
7897
|
-
} : {
|
|
7898
|
-
stackAboveNews: hasOtherScroller
|
|
7899
|
-
};
|
|
7900
|
-
return _to_consumable_array(overlays).concat([
|
|
7901
|
-
createDemoStockTickerOverlay(swirlProjectId, tickerOpts)
|
|
7902
|
-
]);
|
|
7903
|
-
}, [
|
|
7904
|
-
overlays,
|
|
7905
|
-
swirlProjectId,
|
|
7906
|
-
swirlShowcaseDemo,
|
|
7907
|
-
overlayCoordSpace
|
|
7908
|
-
]);
|
|
7831
|
+
var displayOverlays = overlays;
|
|
7909
7832
|
var _import_react2_default_useState18 = _sliced_to_array(import_react2.default.useState(typeof window !== "undefined" ? window.innerWidth : 1920), 2), viewportWidth = _import_react2_default_useState18[0], setViewportWidth = _import_react2_default_useState18[1];
|
|
7910
7833
|
var _import_react2_default_useState19 = _sliced_to_array(import_react2.default.useState(typeof window !== "undefined" ? window.innerHeight > window.innerWidth : false), 2), isPortrait = _import_react2_default_useState19[0], setIsPortrait = _import_react2_default_useState19[1];
|
|
7911
7834
|
var _import_react2_default_useState20 = _sliced_to_array(import_react2.default.useState(DEFAULT_PLAYER_ASPECT_RATIO), 2), playerAspectRatio = _import_react2_default_useState20[0], setPlayerAspectRatio = _import_react2_default_useState20[1];
|