stormcloud-video-player 0.7.39 → 0.7.41
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 +338 -115
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +11 -2
- package/lib/index.d.ts +11 -2
- package/lib/index.js +319 -116
- package/lib/index.js.map +1 -1
- package/lib/ui/OverlayRenderer.cjs +163 -68
- package/lib/ui/OverlayRenderer.cjs.map +1 -1
- package/lib/ui/StormcloudVideoPlayer.cjs +318 -115
- package/lib/ui/StormcloudVideoPlayer.cjs.map +1 -1
- package/lib/utils/overlays.cjs +171 -18
- package/lib/utils/overlays.cjs.map +1 -1
- package/lib/utils/overlays.d.cts +11 -2
- package/package.json +1 -1
|
@@ -5689,6 +5689,126 @@ function isOverlayActive(overlay, currentTime) {
|
|
|
5689
5689
|
if (durationSec <= 0) return false;
|
|
5690
5690
|
return currentTime >= startSec && currentTime < startSec + durationSec;
|
|
5691
5691
|
}
|
|
5692
|
+
var SWIRL_HD_AUTHORING_WIDTH = 1920;
|
|
5693
|
+
var SWIRL_HD_AUTHORING_HEIGHT = 1080;
|
|
5694
|
+
var NAB_DEMO_NAME_PREFIX = "NAB Demo \u2014 ";
|
|
5695
|
+
function overlayAuthoringDimensions(overlay, decodeWidth, decodeHeight) {
|
|
5696
|
+
if (!decodeWidth || !decodeHeight) {
|
|
5697
|
+
return {
|
|
5698
|
+
width: decodeWidth || SWIRL_HD_AUTHORING_WIDTH,
|
|
5699
|
+
height: decodeHeight || SWIRL_HD_AUTHORING_HEIGHT
|
|
5700
|
+
};
|
|
5701
|
+
}
|
|
5702
|
+
if (!overlay.visible) {
|
|
5703
|
+
return {
|
|
5704
|
+
width: decodeWidth,
|
|
5705
|
+
height: decodeHeight
|
|
5706
|
+
};
|
|
5707
|
+
}
|
|
5708
|
+
var extR = overlay.x + overlay.width;
|
|
5709
|
+
var extB = overlay.y + overlay.height;
|
|
5710
|
+
var EPS = 2;
|
|
5711
|
+
var exceedsDecode = extR > decodeWidth + EPS || extB > decodeHeight + EPS;
|
|
5712
|
+
var isNabDemo = overlay.name.startsWith(NAB_DEMO_NAME_PREFIX);
|
|
5713
|
+
var isSyntheticMarketsTicker = overlay.id === -9001 || overlay.name === "Demo stock ticker";
|
|
5714
|
+
if (exceedsDecode && (isNabDemo || isSyntheticMarketsTicker)) {
|
|
5715
|
+
return {
|
|
5716
|
+
width: SWIRL_HD_AUTHORING_WIDTH,
|
|
5717
|
+
height: SWIRL_HD_AUTHORING_HEIGHT
|
|
5718
|
+
};
|
|
5719
|
+
}
|
|
5720
|
+
return {
|
|
5721
|
+
width: decodeWidth,
|
|
5722
|
+
height: decodeHeight
|
|
5723
|
+
};
|
|
5724
|
+
}
|
|
5725
|
+
function overlayExtents(overlays) {
|
|
5726
|
+
var maxR = 0;
|
|
5727
|
+
var maxB = 0;
|
|
5728
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
5729
|
+
try {
|
|
5730
|
+
for(var _iterator = overlays[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
5731
|
+
var o = _step.value;
|
|
5732
|
+
if (!o.visible) continue;
|
|
5733
|
+
maxR = Math.max(maxR, o.x + o.width);
|
|
5734
|
+
maxB = Math.max(maxB, o.y + o.height);
|
|
5735
|
+
}
|
|
5736
|
+
} catch (err) {
|
|
5737
|
+
_didIteratorError = true;
|
|
5738
|
+
_iteratorError = err;
|
|
5739
|
+
} finally{
|
|
5740
|
+
try {
|
|
5741
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
5742
|
+
_iterator.return();
|
|
5743
|
+
}
|
|
5744
|
+
} finally{
|
|
5745
|
+
if (_didIteratorError) {
|
|
5746
|
+
throw _iteratorError;
|
|
5747
|
+
}
|
|
5748
|
+
}
|
|
5749
|
+
}
|
|
5750
|
+
return {
|
|
5751
|
+
maxR: maxR,
|
|
5752
|
+
maxB: maxB
|
|
5753
|
+
};
|
|
5754
|
+
}
|
|
5755
|
+
function swirlProjectHasNabDemoMixedWithOther(overlays) {
|
|
5756
|
+
var hasNab = false;
|
|
5757
|
+
var hasOther = false;
|
|
5758
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
5759
|
+
try {
|
|
5760
|
+
for(var _iterator = overlays[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
5761
|
+
var o = _step.value;
|
|
5762
|
+
if (!o.visible) continue;
|
|
5763
|
+
if (o.name.startsWith(NAB_DEMO_NAME_PREFIX)) hasNab = true;
|
|
5764
|
+
else hasOther = true;
|
|
5765
|
+
}
|
|
5766
|
+
} catch (err) {
|
|
5767
|
+
_didIteratorError = true;
|
|
5768
|
+
_iteratorError = err;
|
|
5769
|
+
} finally{
|
|
5770
|
+
try {
|
|
5771
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
5772
|
+
_iterator.return();
|
|
5773
|
+
}
|
|
5774
|
+
} finally{
|
|
5775
|
+
if (_didIteratorError) {
|
|
5776
|
+
throw _iteratorError;
|
|
5777
|
+
}
|
|
5778
|
+
}
|
|
5779
|
+
}
|
|
5780
|
+
return hasNab && hasOther;
|
|
5781
|
+
}
|
|
5782
|
+
function inferSwirlOverlayCoordinateSpace(overlays, videoWidth, videoHeight) {
|
|
5783
|
+
if (!videoWidth || !videoHeight) {
|
|
5784
|
+
return {
|
|
5785
|
+
width: videoWidth || SWIRL_HD_AUTHORING_WIDTH,
|
|
5786
|
+
height: videoHeight || SWIRL_HD_AUTHORING_HEIGHT
|
|
5787
|
+
};
|
|
5788
|
+
}
|
|
5789
|
+
if (!overlays.length) {
|
|
5790
|
+
return {
|
|
5791
|
+
width: videoWidth,
|
|
5792
|
+
height: videoHeight
|
|
5793
|
+
};
|
|
5794
|
+
}
|
|
5795
|
+
var _overlayExtents = overlayExtents(overlays), maxR = _overlayExtents.maxR, maxB = _overlayExtents.maxB;
|
|
5796
|
+
var EPS = 1;
|
|
5797
|
+
var exceedsDecode = maxR > videoWidth + EPS || maxB > videoHeight + EPS;
|
|
5798
|
+
var fitsHdCanvas = maxR <= SWIRL_HD_AUTHORING_WIDTH + EPS && maxB <= SWIRL_HD_AUTHORING_HEIGHT + EPS;
|
|
5799
|
+
var mixed = swirlProjectHasNabDemoMixedWithOther(overlays);
|
|
5800
|
+
var decodeLargerThanHd = videoWidth > SWIRL_HD_AUTHORING_WIDTH + EPS || videoHeight > SWIRL_HD_AUTHORING_HEIGHT + EPS;
|
|
5801
|
+
if (fitsHdCanvas && (decodeLargerThanHd || exceedsDecode && !mixed)) {
|
|
5802
|
+
return {
|
|
5803
|
+
width: SWIRL_HD_AUTHORING_WIDTH,
|
|
5804
|
+
height: SWIRL_HD_AUTHORING_HEIGHT
|
|
5805
|
+
};
|
|
5806
|
+
}
|
|
5807
|
+
return {
|
|
5808
|
+
width: videoWidth,
|
|
5809
|
+
height: videoHeight
|
|
5810
|
+
};
|
|
5811
|
+
}
|
|
5692
5812
|
function scrollerLooksLikeMarketsStock(o) {
|
|
5693
5813
|
var _ref, _ref1, _ref2, _ref3;
|
|
5694
5814
|
if (o.type !== "scroller") return false;
|
|
@@ -5697,39 +5817,52 @@ function scrollerLooksLikeMarketsStock(o) {
|
|
|
5697
5817
|
return /\b(MARKETS?|NYSE|NASDAQ|DJIA|\bS&P\b|STOCK|AAPL|TSLA|NVDA|EQUITIES)\b/i.test(blob);
|
|
5698
5818
|
}
|
|
5699
5819
|
function createDemoStockTickerOverlay(projectId, opts) {
|
|
5700
|
-
var
|
|
5820
|
+
var cw = (opts === null || opts === void 0 ? void 0 : opts.coordinateWidth) && opts.coordinateWidth > 0 ? opts.coordinateWidth : SWIRL_HD_AUTHORING_WIDTH;
|
|
5821
|
+
var ch = (opts === null || opts === void 0 ? void 0 : opts.coordinateHeight) && opts.coordinateHeight > 0 ? opts.coordinateHeight : SWIRL_HD_AUTHORING_HEIGHT;
|
|
5822
|
+
var sx = cw / SWIRL_HD_AUTHORING_WIDTH;
|
|
5823
|
+
var sy = ch / SWIRL_HD_AUTHORING_HEIGHT;
|
|
5824
|
+
var x = 36 * sx;
|
|
5825
|
+
var y = 1002 * sy;
|
|
5826
|
+
var width = 1848 * sx;
|
|
5827
|
+
var height = 66 * sy;
|
|
5828
|
+
var fontSize = Math.max(8, Math.round(13 * sy));
|
|
5829
|
+
var scrollSpeed = Math.max(8, Math.round(36 * sx));
|
|
5830
|
+
var borderRadius = Math.max(1, Math.round(4 * sy));
|
|
5701
5831
|
return {
|
|
5702
5832
|
id: -9001,
|
|
5703
5833
|
project_id: projectId,
|
|
5704
5834
|
name: "Demo stock ticker",
|
|
5705
5835
|
type: "scroller",
|
|
5706
5836
|
visible: true,
|
|
5707
|
-
x:
|
|
5708
|
-
y:
|
|
5709
|
-
width:
|
|
5710
|
-
height:
|
|
5837
|
+
x: x,
|
|
5838
|
+
y: y,
|
|
5839
|
+
width: width,
|
|
5840
|
+
height: height,
|
|
5711
5841
|
opacity: 100,
|
|
5712
5842
|
start_time: "00:00:00.000",
|
|
5713
5843
|
duration: "24:00:00.000",
|
|
5714
|
-
z_index:
|
|
5844
|
+
z_index: 120,
|
|
5715
5845
|
scroller_config: {
|
|
5846
|
+
preset: "equities_strip",
|
|
5716
5847
|
use_custom_text: true,
|
|
5717
|
-
custom_text: "AAPL +
|
|
5848
|
+
custom_text: "AAPL +0.84% \u2022 MSFT +0.31% \u2022 GOOGL \u22120.22% \u2022 AMZN +0.47% \u2022 NVDA +1.12% \u2022 META +0.19% \u2022 BRK.B +0.11% \u2022 JPM +0.55% \u2022 V +0.28% \u2022 UNH \u22120.17% \u2022 DJIA +0.41% \u2022 S&P 500 +0.29% \u2022 Nasdaq Composite +0.36% \u2022 Russell 2000 +0.52% \u2022 WTI crude $78.40 +0.6% \u2022 Gold $2,348/oz \u22120.2% \u2022 10Y Treasury 4.28%",
|
|
5718
5849
|
direction: "left",
|
|
5719
|
-
scroll_speed:
|
|
5720
|
-
font_size:
|
|
5721
|
-
font_weight: "
|
|
5722
|
-
text_color: "#
|
|
5723
|
-
background_color: "#
|
|
5850
|
+
scroll_speed: scrollSpeed,
|
|
5851
|
+
font_size: fontSize,
|
|
5852
|
+
font_weight: "600",
|
|
5853
|
+
text_color: "#e2e8f0",
|
|
5854
|
+
background_color: "#0a0f18",
|
|
5724
5855
|
background_opacity: 92,
|
|
5725
|
-
border_radius:
|
|
5726
|
-
|
|
5727
|
-
|
|
5728
|
-
|
|
5729
|
-
|
|
5856
|
+
border_radius: borderRadius,
|
|
5857
|
+
padding: Math.max(3, Math.round(6 * sy)),
|
|
5858
|
+
label: "U.S. equities",
|
|
5859
|
+
label_line2: "",
|
|
5860
|
+
label_color: "#1e3a5f",
|
|
5861
|
+
label_text_color: "#f8fafc",
|
|
5730
5862
|
accent_color: "#38bdf8",
|
|
5731
5863
|
show_accent_line: true,
|
|
5732
|
-
separator_char: "\u2022"
|
|
5864
|
+
separator_char: "\u2022",
|
|
5865
|
+
item_spacing: Math.max(28, Math.round(48 * sx))
|
|
5733
5866
|
}
|
|
5734
5867
|
};
|
|
5735
5868
|
}
|
|
@@ -6172,12 +6305,14 @@ function ScrollerOverlay(param) {
|
|
|
6172
6305
|
var bgOpacity = (cfg === null || cfg === void 0 ? void 0 : cfg.background_opacity) !== void 0 ? cfg.background_opacity / 100 : 0.95;
|
|
6173
6306
|
var borderRadius = (_ref6 = cfg === null || cfg === void 0 ? void 0 : cfg.border_radius) !== null && _ref6 !== void 0 ? _ref6 : 0;
|
|
6174
6307
|
var itemSpacing = (_ref7 = cfg === null || cfg === void 0 ? void 0 : cfg.item_spacing) !== null && _ref7 !== void 0 ? _ref7 : 60;
|
|
6308
|
+
var pad = (cfg === null || cfg === void 0 ? void 0 : cfg.padding) !== void 0 && cfg.padding >= 0 ? cfg.padding : 8;
|
|
6175
6309
|
var label = (_ref8 = cfg === null || cfg === void 0 ? void 0 : cfg.label) !== null && _ref8 !== void 0 ? _ref8 : "NEWS";
|
|
6176
6310
|
var labelLine2 = (_ref9 = cfg === null || cfg === void 0 ? void 0 : cfg.label_line2) !== null && _ref9 !== void 0 ? _ref9 : "";
|
|
6177
6311
|
var labelColor = (_ref10 = cfg === null || cfg === void 0 ? void 0 : cfg.label_color) !== null && _ref10 !== void 0 ? _ref10 : "#f97316";
|
|
6178
6312
|
var labelTextColor = (_ref11 = cfg === null || cfg === void 0 ? void 0 : cfg.label_text_color) !== null && _ref11 !== void 0 ? _ref11 : "#ffffff";
|
|
6179
6313
|
var accentColor = (_ref12 = cfg === null || cfg === void 0 ? void 0 : cfg.accent_color) !== null && _ref12 !== void 0 ? _ref12 : labelColor;
|
|
6180
6314
|
var showAccentLine = (cfg === null || cfg === void 0 ? void 0 : cfg.show_accent_line) !== false;
|
|
6315
|
+
var isEquitiesStrip = (cfg === null || cfg === void 0 ? void 0 : cfg.preset) === "equities_strip";
|
|
6181
6316
|
var isHorizontal = direction === "left" || direction === "right";
|
|
6182
6317
|
var isReverse = direction === "right" || direction === "down";
|
|
6183
6318
|
var fullText = segments.join(" ".concat(sep, " "));
|
|
@@ -6208,7 +6343,7 @@ function ScrollerOverlay(param) {
|
|
|
6208
6343
|
children: [
|
|
6209
6344
|
showAccentLine && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
6210
6345
|
style: {
|
|
6211
|
-
height: 3,
|
|
6346
|
+
height: isEquitiesStrip ? 2 : 3,
|
|
6212
6347
|
background: accentColor,
|
|
6213
6348
|
flexShrink: 0,
|
|
6214
6349
|
width: "100%"
|
|
@@ -6219,42 +6354,50 @@ function ScrollerOverlay(param) {
|
|
|
6219
6354
|
display: "flex",
|
|
6220
6355
|
flex: 1,
|
|
6221
6356
|
overflow: "hidden",
|
|
6222
|
-
minHeight: 0
|
|
6357
|
+
minHeight: 0,
|
|
6358
|
+
alignItems: "center",
|
|
6359
|
+
padding: isEquitiesStrip ? "".concat(Math.max(2, pad * 0.5), "px ").concat(pad, "px") : "".concat(Math.max(4, pad * 0.75), "px ").concat(pad, "px"),
|
|
6360
|
+
gap: isEquitiesStrip ? Math.max(4, Math.round(pad * 0.75)) : Math.max(6, pad),
|
|
6361
|
+
boxSizing: "border-box"
|
|
6223
6362
|
},
|
|
6224
6363
|
children: [
|
|
6225
6364
|
label && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
6226
6365
|
style: {
|
|
6227
6366
|
background: labelColor,
|
|
6228
6367
|
color: labelTextColor,
|
|
6229
|
-
padding: "
|
|
6368
|
+
padding: isEquitiesStrip ? "6px 12px" : "10px 14px",
|
|
6230
6369
|
display: "flex",
|
|
6231
|
-
flexDirection: "column",
|
|
6370
|
+
flexDirection: isEquitiesStrip ? "row" : "column",
|
|
6232
6371
|
alignItems: "center",
|
|
6233
6372
|
justifyContent: "center",
|
|
6234
6373
|
flexShrink: 0,
|
|
6235
|
-
minWidth: 72,
|
|
6236
6374
|
textAlign: "center",
|
|
6237
|
-
gap:
|
|
6375
|
+
gap: isEquitiesStrip ? 0 : 2,
|
|
6376
|
+
borderRadius: Math.max(2, borderRadius > 0 ? borderRadius : 6),
|
|
6377
|
+
boxShadow: isEquitiesStrip ? "inset 0 1px 0 rgba(255,255,255,0.08)" : "0 2px 8px rgba(0,0,0,0.35)",
|
|
6378
|
+
alignSelf: "stretch",
|
|
6379
|
+
maxWidth: isEquitiesStrip ? "min(200px, 28%)" : void 0
|
|
6238
6380
|
},
|
|
6239
6381
|
children: [
|
|
6240
6382
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
6241
6383
|
style: {
|
|
6242
|
-
fontWeight: 800,
|
|
6243
|
-
fontSize: "0.82em",
|
|
6244
|
-
letterSpacing: "0.
|
|
6245
|
-
lineHeight: 1.
|
|
6246
|
-
textTransform: "uppercase",
|
|
6247
|
-
whiteSpace: "nowrap"
|
|
6384
|
+
fontWeight: isEquitiesStrip ? 700 : 800,
|
|
6385
|
+
fontSize: isEquitiesStrip ? "0.82em" : "0.78em",
|
|
6386
|
+
letterSpacing: isEquitiesStrip ? "0.04em" : "0.08em",
|
|
6387
|
+
lineHeight: 1.2,
|
|
6388
|
+
textTransform: isEquitiesStrip ? "none" : "uppercase",
|
|
6389
|
+
whiteSpace: isEquitiesStrip ? "normal" : "nowrap",
|
|
6390
|
+
textAlign: isEquitiesStrip ? "left" : "center"
|
|
6248
6391
|
},
|
|
6249
6392
|
children: label
|
|
6250
6393
|
}),
|
|
6251
|
-
labelLine2 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
6394
|
+
labelLine2 && !isEquitiesStrip && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
6252
6395
|
style: {
|
|
6253
|
-
fontWeight:
|
|
6254
|
-
fontSize: "0.
|
|
6255
|
-
letterSpacing: "0.
|
|
6256
|
-
lineHeight: 1.
|
|
6257
|
-
opacity: 0.
|
|
6396
|
+
fontWeight: 600,
|
|
6397
|
+
fontSize: "0.58em",
|
|
6398
|
+
letterSpacing: "0.06em",
|
|
6399
|
+
lineHeight: 1.15,
|
|
6400
|
+
opacity: 0.92,
|
|
6258
6401
|
whiteSpace: "nowrap"
|
|
6259
6402
|
},
|
|
6260
6403
|
children: labelLine2
|
|
@@ -6263,9 +6406,13 @@ function ScrollerOverlay(param) {
|
|
|
6263
6406
|
}),
|
|
6264
6407
|
label && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
6265
6408
|
style: {
|
|
6266
|
-
width:
|
|
6409
|
+
width: isEquitiesStrip ? 1 : 2,
|
|
6410
|
+
alignSelf: "stretch",
|
|
6411
|
+
minHeight: isEquitiesStrip ? 20 : 24,
|
|
6267
6412
|
background: accentColor,
|
|
6268
|
-
flexShrink: 0
|
|
6413
|
+
flexShrink: 0,
|
|
6414
|
+
borderRadius: 1,
|
|
6415
|
+
opacity: 0.85
|
|
6269
6416
|
}
|
|
6270
6417
|
}),
|
|
6271
6418
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
@@ -6274,7 +6421,8 @@ function ScrollerOverlay(param) {
|
|
|
6274
6421
|
overflow: "hidden",
|
|
6275
6422
|
position: "relative",
|
|
6276
6423
|
display: "flex",
|
|
6277
|
-
alignItems: "center"
|
|
6424
|
+
alignItems: "center",
|
|
6425
|
+
minWidth: 0
|
|
6278
6426
|
},
|
|
6279
6427
|
children: isHorizontal ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
6280
6428
|
style: {
|
|
@@ -6354,21 +6502,22 @@ function ScoreBugOverlay(param) {
|
|
|
6354
6502
|
var overlay = param.overlay, size = param.size;
|
|
6355
6503
|
var cfg = parseConfig(overlay.content);
|
|
6356
6504
|
if (!cfg) return null;
|
|
6357
|
-
var f = Math.max(6, size.w * 0.
|
|
6505
|
+
var f = Math.max(6, size.w * 0.052);
|
|
6358
6506
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
6359
6507
|
style: {
|
|
6360
6508
|
width: "100%",
|
|
6361
6509
|
height: "100%",
|
|
6362
|
-
borderRadius: Math.max(2, size.w * 0.
|
|
6510
|
+
borderRadius: Math.max(2, size.w * 0.028),
|
|
6363
6511
|
display: "flex",
|
|
6364
6512
|
flexDirection: "column",
|
|
6365
6513
|
background: cfg.backgroundColor,
|
|
6366
6514
|
color: cfg.textColor,
|
|
6367
|
-
fontFamily: "Roboto, 'Segoe UI',
|
|
6515
|
+
fontFamily: "'Inter', 'Roboto', 'Segoe UI', system-ui, sans-serif",
|
|
6368
6516
|
overflow: "hidden",
|
|
6369
6517
|
pointerEvents: "none",
|
|
6370
6518
|
userSelect: "none",
|
|
6371
|
-
fontSize: "".concat(f, "px")
|
|
6519
|
+
fontSize: "".concat(f, "px"),
|
|
6520
|
+
boxShadow: "0 8px 28px rgba(0,0,0,0.45)"
|
|
6372
6521
|
},
|
|
6373
6522
|
children: [
|
|
6374
6523
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
@@ -6376,28 +6525,36 @@ function ScoreBugOverlay(param) {
|
|
|
6376
6525
|
flex: 1,
|
|
6377
6526
|
display: "flex",
|
|
6378
6527
|
alignItems: "center",
|
|
6379
|
-
padding: "0 ".concat(f * 0.
|
|
6380
|
-
gap: f * 0.
|
|
6528
|
+
padding: "".concat(f * 0.42, "px ").concat(f * 0.85, "px"),
|
|
6529
|
+
gap: f * 0.45,
|
|
6530
|
+
minHeight: 0
|
|
6381
6531
|
},
|
|
6382
6532
|
children: [
|
|
6383
6533
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
6384
6534
|
style: {
|
|
6385
6535
|
flex: 1,
|
|
6386
|
-
textAlign: "center"
|
|
6536
|
+
textAlign: "center",
|
|
6537
|
+
minWidth: 0,
|
|
6538
|
+
padding: "0 ".concat(f * 0.15, "px")
|
|
6387
6539
|
},
|
|
6388
6540
|
children: [
|
|
6389
6541
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
6390
6542
|
style: {
|
|
6391
|
-
fontSize: "
|
|
6392
|
-
fontWeight:
|
|
6543
|
+
fontSize: "1.05em",
|
|
6544
|
+
fontWeight: 800,
|
|
6545
|
+
letterSpacing: "0.02em",
|
|
6546
|
+
overflow: "hidden",
|
|
6547
|
+
textOverflow: "ellipsis",
|
|
6548
|
+
whiteSpace: "nowrap"
|
|
6393
6549
|
},
|
|
6394
6550
|
children: cfg.homeTeam
|
|
6395
6551
|
}),
|
|
6396
6552
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
6397
6553
|
style: {
|
|
6398
|
-
fontSize: "1.
|
|
6554
|
+
fontSize: "1.75em",
|
|
6399
6555
|
fontWeight: 900,
|
|
6400
|
-
lineHeight: 1
|
|
6556
|
+
lineHeight: 1.05,
|
|
6557
|
+
marginTop: f * 0.08
|
|
6401
6558
|
},
|
|
6402
6559
|
children: cfg.homeScore
|
|
6403
6560
|
})
|
|
@@ -6405,16 +6562,26 @@ function ScoreBugOverlay(param) {
|
|
|
6405
6562
|
}),
|
|
6406
6563
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
6407
6564
|
style: {
|
|
6408
|
-
fontSize: "0.
|
|
6565
|
+
fontSize: "0.88em",
|
|
6409
6566
|
textAlign: "center",
|
|
6410
|
-
|
|
6411
|
-
|
|
6567
|
+
fontWeight: 600,
|
|
6568
|
+
opacity: 0.92,
|
|
6569
|
+
color: cfg.textColor,
|
|
6570
|
+
padding: "0 ".concat(f * 0.5, "px"),
|
|
6571
|
+
flexShrink: 0,
|
|
6572
|
+
lineHeight: 1.25,
|
|
6573
|
+
textTransform: "uppercase",
|
|
6574
|
+
letterSpacing: "0.04em"
|
|
6412
6575
|
},
|
|
6413
6576
|
children: [
|
|
6414
6577
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
6415
6578
|
children: cfg.period
|
|
6416
6579
|
}),
|
|
6417
6580
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
6581
|
+
style: {
|
|
6582
|
+
fontWeight: 700,
|
|
6583
|
+
opacity: 1
|
|
6584
|
+
},
|
|
6418
6585
|
children: cfg.clock
|
|
6419
6586
|
})
|
|
6420
6587
|
]
|
|
@@ -6422,21 +6589,28 @@ function ScoreBugOverlay(param) {
|
|
|
6422
6589
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
6423
6590
|
style: {
|
|
6424
6591
|
flex: 1,
|
|
6425
|
-
textAlign: "center"
|
|
6592
|
+
textAlign: "center",
|
|
6593
|
+
minWidth: 0,
|
|
6594
|
+
padding: "0 ".concat(f * 0.15, "px")
|
|
6426
6595
|
},
|
|
6427
6596
|
children: [
|
|
6428
6597
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
6429
6598
|
style: {
|
|
6430
|
-
fontSize: "
|
|
6431
|
-
fontWeight:
|
|
6599
|
+
fontSize: "1.05em",
|
|
6600
|
+
fontWeight: 800,
|
|
6601
|
+
letterSpacing: "0.02em",
|
|
6602
|
+
overflow: "hidden",
|
|
6603
|
+
textOverflow: "ellipsis",
|
|
6604
|
+
whiteSpace: "nowrap"
|
|
6432
6605
|
},
|
|
6433
6606
|
children: cfg.awayTeam
|
|
6434
6607
|
}),
|
|
6435
6608
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
6436
6609
|
style: {
|
|
6437
|
-
fontSize: "1.
|
|
6610
|
+
fontSize: "1.75em",
|
|
6438
6611
|
fontWeight: 900,
|
|
6439
|
-
lineHeight: 1
|
|
6612
|
+
lineHeight: 1.05,
|
|
6613
|
+
marginTop: f * 0.08
|
|
6440
6614
|
},
|
|
6441
6615
|
children: cfg.awayScore
|
|
6442
6616
|
})
|
|
@@ -6446,23 +6620,27 @@ function ScoreBugOverlay(param) {
|
|
|
6446
6620
|
}),
|
|
6447
6621
|
(cfg.sponsorText || cfg.sponsorImageUrl) && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
6448
6622
|
style: {
|
|
6449
|
-
fontSize: "0.
|
|
6623
|
+
fontSize: "0.72em",
|
|
6450
6624
|
textAlign: "center",
|
|
6451
|
-
|
|
6452
|
-
|
|
6453
|
-
|
|
6625
|
+
fontWeight: 600,
|
|
6626
|
+
opacity: 0.88,
|
|
6627
|
+
padding: "".concat(f * 0.34, "px ").concat(f * 0.55, "px"),
|
|
6628
|
+
borderTop: "1px solid ".concat(cfg.accentColor, "55"),
|
|
6454
6629
|
display: "flex",
|
|
6455
6630
|
alignItems: "center",
|
|
6456
6631
|
justifyContent: "center",
|
|
6457
|
-
gap: f * 0.
|
|
6458
|
-
overflow: "hidden"
|
|
6632
|
+
gap: f * 0.45,
|
|
6633
|
+
overflow: "hidden",
|
|
6634
|
+
letterSpacing: "0.04em",
|
|
6635
|
+
textTransform: "uppercase",
|
|
6636
|
+
background: "linear-gradient(180deg, rgba(0,0,0,0.12) 0%, rgba(0,0,0,0.22) 100%)"
|
|
6459
6637
|
},
|
|
6460
6638
|
children: [
|
|
6461
6639
|
cfg.sponsorImageUrl && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
|
|
6462
6640
|
src: cfg.sponsorImageUrl,
|
|
6463
6641
|
alt: "sponsor",
|
|
6464
6642
|
style: {
|
|
6465
|
-
height: "".concat(f * 1.
|
|
6643
|
+
height: "".concat(f * 1.35, "px"),
|
|
6466
6644
|
objectFit: "contain",
|
|
6467
6645
|
flexShrink: 0
|
|
6468
6646
|
}
|
|
@@ -6484,29 +6662,32 @@ function LowerThirdOverlay(param) {
|
|
|
6484
6662
|
var overlay = param.overlay, size = param.size;
|
|
6485
6663
|
var cfg = parseConfig(overlay.content);
|
|
6486
6664
|
if (!cfg) return null;
|
|
6487
|
-
var f = Math.max(6, size.w * 0.
|
|
6665
|
+
var f = Math.max(6, size.w * 0.05);
|
|
6666
|
+
var accentH = Math.max(3, size.h * 0.038);
|
|
6488
6667
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
6489
6668
|
style: {
|
|
6490
6669
|
width: "100%",
|
|
6491
6670
|
height: "100%",
|
|
6492
|
-
borderRadius: Math.max(2, size.w * 0.
|
|
6671
|
+
borderRadius: Math.max(2, size.w * 0.018),
|
|
6493
6672
|
display: "flex",
|
|
6494
6673
|
flexDirection: "column",
|
|
6495
6674
|
justifyContent: "flex-end",
|
|
6496
6675
|
background: cfg.backgroundColor,
|
|
6497
6676
|
color: cfg.textColor,
|
|
6498
|
-
fontFamily: "Roboto, 'Segoe UI',
|
|
6677
|
+
fontFamily: "'Inter', 'Roboto', 'Segoe UI', system-ui, sans-serif",
|
|
6499
6678
|
overflow: "hidden",
|
|
6500
6679
|
pointerEvents: "none",
|
|
6501
6680
|
userSelect: "none",
|
|
6502
|
-
fontSize: "".concat(f, "px")
|
|
6681
|
+
fontSize: "".concat(f, "px"),
|
|
6682
|
+
boxShadow: "0 10px 32px rgba(0,0,0,0.4)"
|
|
6503
6683
|
},
|
|
6504
6684
|
children: [
|
|
6505
6685
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
6506
6686
|
style: {
|
|
6507
6687
|
width: "100%",
|
|
6508
|
-
height:
|
|
6509
|
-
backgroundColor: cfg.accentColor
|
|
6688
|
+
height: accentH,
|
|
6689
|
+
backgroundColor: cfg.accentColor,
|
|
6690
|
+
flexShrink: 0
|
|
6510
6691
|
}
|
|
6511
6692
|
}),
|
|
6512
6693
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
@@ -6515,23 +6696,28 @@ function LowerThirdOverlay(param) {
|
|
|
6515
6696
|
display: "flex",
|
|
6516
6697
|
flexDirection: "column",
|
|
6517
6698
|
justifyContent: "center",
|
|
6518
|
-
padding: "".concat(f * 0.
|
|
6699
|
+
padding: "".concat(f * 0.62, "px ").concat(f * 1.05, "px"),
|
|
6700
|
+
minHeight: 0,
|
|
6701
|
+
gap: f * 0.18
|
|
6519
6702
|
},
|
|
6520
6703
|
children: [
|
|
6521
6704
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
6522
6705
|
style: {
|
|
6523
|
-
fontSize: "1.
|
|
6524
|
-
fontWeight:
|
|
6525
|
-
lineHeight: 1.
|
|
6526
|
-
|
|
6706
|
+
fontSize: "1.28em",
|
|
6707
|
+
fontWeight: 800,
|
|
6708
|
+
lineHeight: 1.22,
|
|
6709
|
+
letterSpacing: "0.01em",
|
|
6710
|
+
textShadow: "0 2px 6px rgba(0,0,0,0.55)"
|
|
6527
6711
|
},
|
|
6528
6712
|
children: cfg.headline
|
|
6529
6713
|
}),
|
|
6530
6714
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
6531
6715
|
style: {
|
|
6532
|
-
fontSize: "
|
|
6533
|
-
|
|
6534
|
-
|
|
6716
|
+
fontSize: "0.94em",
|
|
6717
|
+
fontWeight: 500,
|
|
6718
|
+
opacity: 0.92,
|
|
6719
|
+
lineHeight: 1.35,
|
|
6720
|
+
color: cfg.textColor
|
|
6535
6721
|
},
|
|
6536
6722
|
children: cfg.subtitle
|
|
6537
6723
|
})
|
|
@@ -6539,20 +6725,24 @@ function LowerThirdOverlay(param) {
|
|
|
6539
6725
|
}),
|
|
6540
6726
|
(cfg.sponsorText || cfg.sponsorImageUrl) && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
6541
6727
|
style: {
|
|
6542
|
-
fontSize: "0.
|
|
6543
|
-
|
|
6544
|
-
|
|
6728
|
+
fontSize: "0.68em",
|
|
6729
|
+
fontWeight: 600,
|
|
6730
|
+
opacity: 0.72,
|
|
6731
|
+
padding: "".concat(f * 0.28, "px ").concat(f * 1.05, "px ").concat(f * 0.48, "px"),
|
|
6545
6732
|
display: "flex",
|
|
6546
6733
|
alignItems: "center",
|
|
6547
6734
|
gap: f * 0.4,
|
|
6548
|
-
overflow: "hidden"
|
|
6735
|
+
overflow: "hidden",
|
|
6736
|
+
letterSpacing: "0.06em",
|
|
6737
|
+
textTransform: "uppercase",
|
|
6738
|
+
borderTop: "1px solid rgba(255,255,255,0.08)"
|
|
6549
6739
|
},
|
|
6550
6740
|
children: [
|
|
6551
6741
|
cfg.sponsorImageUrl && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
|
|
6552
6742
|
src: cfg.sponsorImageUrl,
|
|
6553
6743
|
alt: "sponsor",
|
|
6554
6744
|
style: {
|
|
6555
|
-
height: "".concat(f * 1.
|
|
6745
|
+
height: "".concat(f * 1.25, "px"),
|
|
6556
6746
|
objectFit: "contain",
|
|
6557
6747
|
flexShrink: 0
|
|
6558
6748
|
}
|
|
@@ -7466,8 +7656,13 @@ var OverlayRenderer = function OverlayRenderer(param) {
|
|
|
7466
7656
|
},
|
|
7467
7657
|
children: _to_consumable_array(fadeMap.values()).map(function(param) {
|
|
7468
7658
|
var overlay = param.overlay, visible = param.visible;
|
|
7469
|
-
var
|
|
7470
|
-
var
|
|
7659
|
+
var uniform = coordinateSpace && coordinateSpace.width > 0 && coordinateSpace.height > 0;
|
|
7660
|
+
var auth = uniform ? {
|
|
7661
|
+
width: coordinateSpace.width,
|
|
7662
|
+
height: coordinateSpace.height
|
|
7663
|
+
} : overlayAuthoringDimensions(overlay, dims.nativeWidth, dims.nativeHeight);
|
|
7664
|
+
var scaleX = dims.displayWidth / auth.width;
|
|
7665
|
+
var scaleY = dims.displayHeight / auth.height;
|
|
7471
7666
|
var left = overlay.x * scaleX;
|
|
7472
7667
|
var top = overlay.y * scaleY;
|
|
7473
7668
|
var width = overlay.width * scaleX;
|
|
@@ -7690,23 +7885,28 @@ var StormcloudVideoPlayerComponent = import_react2.default.memo(function(props)
|
|
|
7690
7885
|
}, [
|
|
7691
7886
|
swirlOverlayApiBaseUrl
|
|
7692
7887
|
]);
|
|
7888
|
+
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];
|
|
7693
7889
|
var displayOverlays = import_react2.default.useMemo(function() {
|
|
7694
7890
|
if (!swirlProjectId || !swirlShowcaseDemo) return overlays;
|
|
7695
7891
|
if (overlays.some(scrollerLooksLikeMarketsStock)) return overlays;
|
|
7696
|
-
|
|
7697
|
-
return o.type === "scroller";
|
|
7698
|
-
});
|
|
7892
|
+
if (overlays.some(function(o) {
|
|
7893
|
+
return o.visible && o.type === "scroller";
|
|
7894
|
+
})) return overlays;
|
|
7895
|
+
var cw = overlayCoordSpace === null || overlayCoordSpace === void 0 ? void 0 : overlayCoordSpace.width;
|
|
7896
|
+
var ch = overlayCoordSpace === null || overlayCoordSpace === void 0 ? void 0 : overlayCoordSpace.height;
|
|
7897
|
+
var tickerOpts = cw && cw > 0 && ch && ch > 0 ? {
|
|
7898
|
+
coordinateWidth: cw,
|
|
7899
|
+
coordinateHeight: ch
|
|
7900
|
+
} : {};
|
|
7699
7901
|
return _to_consumable_array(overlays).concat([
|
|
7700
|
-
createDemoStockTickerOverlay(swirlProjectId,
|
|
7701
|
-
stackAboveNews: hasOtherScroller
|
|
7702
|
-
})
|
|
7902
|
+
createDemoStockTickerOverlay(swirlProjectId, tickerOpts)
|
|
7703
7903
|
]);
|
|
7704
7904
|
}, [
|
|
7705
7905
|
overlays,
|
|
7706
7906
|
swirlProjectId,
|
|
7707
|
-
swirlShowcaseDemo
|
|
7907
|
+
swirlShowcaseDemo,
|
|
7908
|
+
overlayCoordSpace
|
|
7708
7909
|
]);
|
|
7709
|
-
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];
|
|
7710
7910
|
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];
|
|
7711
7911
|
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];
|
|
7712
7912
|
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];
|
|
@@ -8002,8 +8202,7 @@ var StormcloudVideoPlayerComponent = import_react2.default.memo(function(props)
|
|
|
8002
8202
|
var _playerRef_current;
|
|
8003
8203
|
if (!swirlProjectId) return;
|
|
8004
8204
|
var tryResolve = function tryResolve() {
|
|
8005
|
-
var
|
|
8006
|
-
var player = playerRef.current;
|
|
8205
|
+
var _ref, _ref1;
|
|
8007
8206
|
var fixed = swirlOverlayCoordinateSpace;
|
|
8008
8207
|
if (fixed && fixed.width > 0 && fixed.height > 0) {
|
|
8009
8208
|
setOverlayCoordSpace({
|
|
@@ -8012,26 +8211,29 @@ var StormcloudVideoPlayerComponent = import_react2.default.memo(function(props)
|
|
|
8012
8211
|
});
|
|
8013
8212
|
return true;
|
|
8014
8213
|
}
|
|
8214
|
+
var player = playerRef.current;
|
|
8015
8215
|
if (!player) return false;
|
|
8016
8216
|
var video2 = player.videoElement;
|
|
8017
|
-
|
|
8018
|
-
|
|
8019
|
-
|
|
8020
|
-
|
|
8021
|
-
|
|
8022
|
-
|
|
8023
|
-
|
|
8024
|
-
|
|
8025
|
-
|
|
8026
|
-
|
|
8027
|
-
|
|
8028
|
-
|
|
8029
|
-
|
|
8030
|
-
|
|
8031
|
-
|
|
8032
|
-
|
|
8217
|
+
var vw = (_ref = video2 === null || video2 === void 0 ? void 0 : video2.videoWidth) !== null && _ref !== void 0 ? _ref : 0;
|
|
8218
|
+
var vh = (_ref1 = video2 === null || video2 === void 0 ? void 0 : video2.videoHeight) !== null && _ref1 !== void 0 ? _ref1 : 0;
|
|
8219
|
+
if (!vw || !vh) {
|
|
8220
|
+
var _player_getMaxHlsResolution;
|
|
8221
|
+
var maxRes = (_player_getMaxHlsResolution = player.getMaxHlsResolution) === null || _player_getMaxHlsResolution === void 0 ? void 0 : _player_getMaxHlsResolution.call(player);
|
|
8222
|
+
if (maxRes && maxRes.width > 0 && maxRes.height > 0) {
|
|
8223
|
+
vw = maxRes.width;
|
|
8224
|
+
vh = maxRes.height;
|
|
8225
|
+
} else {
|
|
8226
|
+
var _player_getMinHlsResolution;
|
|
8227
|
+
var minRes = (_player_getMinHlsResolution = player.getMinHlsResolution) === null || _player_getMinHlsResolution === void 0 ? void 0 : _player_getMinHlsResolution.call(player);
|
|
8228
|
+
if (minRes && minRes.width > 0 && minRes.height > 0) {
|
|
8229
|
+
vw = minRes.width;
|
|
8230
|
+
vh = minRes.height;
|
|
8231
|
+
}
|
|
8232
|
+
}
|
|
8033
8233
|
}
|
|
8034
|
-
return false;
|
|
8234
|
+
if (!vw || !vh) return false;
|
|
8235
|
+
setOverlayCoordSpace(inferSwirlOverlayCoordinateSpace(overlays, vw, vh));
|
|
8236
|
+
return true;
|
|
8035
8237
|
};
|
|
8036
8238
|
var attempts = 0;
|
|
8037
8239
|
var maxAttempts = 40;
|
|
@@ -8057,7 +8259,8 @@ var StormcloudVideoPlayerComponent = import_react2.default.memo(function(props)
|
|
|
8057
8259
|
}, [
|
|
8058
8260
|
swirlProjectId,
|
|
8059
8261
|
criticalPropsKey,
|
|
8060
|
-
swirlOverlayCoordinateSpace
|
|
8262
|
+
swirlOverlayCoordinateSpace,
|
|
8263
|
+
overlays
|
|
8061
8264
|
]);
|
|
8062
8265
|
(0, import_react2.useEffect)(function() {
|
|
8063
8266
|
if (!playerRef.current) return;
|
|
@@ -8488,7 +8691,7 @@ var StormcloudVideoPlayerComponent = import_react2.default.memo(function(props)
|
|
|
8488
8691
|
overlays: displayOverlays,
|
|
8489
8692
|
currentTime: currentTime,
|
|
8490
8693
|
videoRef: videoRef,
|
|
8491
|
-
coordinateSpace:
|
|
8694
|
+
coordinateSpace: swirlOverlayCoordinateSpace && swirlOverlayCoordinateSpace.width > 0 && swirlOverlayCoordinateSpace.height > 0 ? swirlOverlayCoordinateSpace : null,
|
|
8492
8695
|
showcaseMode: !!swirlShowcaseDemo
|
|
8493
8696
|
}),
|
|
8494
8697
|
(isLoading || isBuffering) && !hideLoadingIndicator && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|