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/lib/index.cjs CHANGED
@@ -470,9 +470,6 @@ __export(index_exports, {
470
470
  createAdStormPlayer: function createAdStormPlayer1() {
471
471
  return createAdStormPlayer;
472
472
  },
473
- createDemoStockTickerOverlay: function createDemoStockTickerOverlay1() {
474
- return createDemoStockTickerOverlay;
475
- },
476
473
  createStormcloudPlayer: function createStormcloudPlayer1() {
477
474
  return createStormcloudPlayer;
478
475
  },
@@ -536,9 +533,6 @@ __export(index_exports, {
536
533
  resolveImageUrl: function resolveImageUrl1() {
537
534
  return resolveImageUrl;
538
535
  },
539
- scrollerLooksLikeMarketsStock: function scrollerLooksLikeMarketsStock1() {
540
- return scrollerLooksLikeMarketsStock;
541
- },
542
536
  sendHeartbeat: function sendHeartbeat1() {
543
537
  return sendHeartbeat;
544
538
  },
@@ -5915,8 +5909,7 @@ function overlayAuthoringDimensions(overlay, decodeWidth, decodeHeight) {
5915
5909
  var EPS = 2;
5916
5910
  var exceedsDecode = extR > decodeWidth + EPS || extB > decodeHeight + EPS;
5917
5911
  var isNabDemo = overlay.name.startsWith(NAB_DEMO_NAME_PREFIX);
5918
- var isSyntheticMarketsTicker = overlay.id === -9001 || overlay.name === "Demo stock ticker";
5919
- if (exceedsDecode && (isNabDemo || isSyntheticMarketsTicker)) {
5912
+ if (exceedsDecode && isNabDemo) {
5920
5913
  return {
5921
5914
  width: SWIRL_HD_AUTHORING_WIDTH,
5922
5915
  height: SWIRL_HD_AUTHORING_HEIGHT
@@ -6014,63 +6007,6 @@ function inferSwirlOverlayCoordinateSpace(overlays, videoWidth, videoHeight) {
6014
6007
  height: videoHeight
6015
6008
  };
6016
6009
  }
6017
- function scrollerLooksLikeMarketsStock(o) {
6018
- var _ref, _ref1, _ref2, _ref3;
6019
- if (o.type !== "scroller") return false;
6020
- var cfg = o.scroller_config;
6021
- 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 : "");
6022
- return /\b(MARKETS?|NYSE|NASDAQ|DJIA|\bS&P\b|STOCK|AAPL|TSLA|NVDA|EQUITIES)\b/i.test(blob);
6023
- }
6024
- function createDemoStockTickerOverlay(projectId, opts) {
6025
- var stack = (opts === null || opts === void 0 ? void 0 : opts.stackAboveNews) === true;
6026
- var cw = (opts === null || opts === void 0 ? void 0 : opts.coordinateWidth) && opts.coordinateWidth > 0 ? opts.coordinateWidth : SWIRL_HD_AUTHORING_WIDTH;
6027
- var ch = (opts === null || opts === void 0 ? void 0 : opts.coordinateHeight) && opts.coordinateHeight > 0 ? opts.coordinateHeight : SWIRL_HD_AUTHORING_HEIGHT;
6028
- var sx = cw / SWIRL_HD_AUTHORING_WIDTH;
6029
- var sy = ch / SWIRL_HD_AUTHORING_HEIGHT;
6030
- var x = 36 * sx;
6031
- var y = (stack ? 788 : 992) * sy;
6032
- var width = 1848 * sx;
6033
- var height = (stack ? 72 : 78) * sy;
6034
- var fontSize = Math.max(8, Math.round(14 * sy));
6035
- var scrollSpeed = Math.max(8, Math.round(38 * sx));
6036
- var borderRadius = Math.max(1, Math.round(6 * sy));
6037
- return {
6038
- id: -9001,
6039
- project_id: projectId,
6040
- name: "Demo stock ticker",
6041
- type: "scroller",
6042
- visible: true,
6043
- x: x,
6044
- y: y,
6045
- width: width,
6046
- height: height,
6047
- opacity: 100,
6048
- start_time: "00:00:00.000",
6049
- duration: "24:00:00.000",
6050
- z_index: stack ? 125 : 120,
6051
- scroller_config: {
6052
- use_custom_text: true,
6053
- 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%",
6054
- direction: "left",
6055
- scroll_speed: scrollSpeed,
6056
- font_size: fontSize,
6057
- font_weight: "600",
6058
- text_color: "#e2e8f0",
6059
- background_color: "#070b14",
6060
- background_opacity: 94,
6061
- border_radius: borderRadius,
6062
- padding: Math.max(4, Math.round(8 * sy)),
6063
- label: "MARKETS",
6064
- label_line2: "LIVE",
6065
- label_color: "#0e7490",
6066
- label_text_color: "#ecfeff",
6067
- accent_color: "#22d3ee",
6068
- show_accent_line: true,
6069
- separator_char: "\u2022",
6070
- item_spacing: Math.max(32, Math.round(56 * sx))
6071
- }
6072
- };
6073
- }
6074
6010
  function normalizeScrollerConfig(raw) {
6075
6011
  if (!raw || (typeof raw === "undefined" ? "undefined" : _type_of(raw)) !== "object") return void 0;
6076
6012
  var r = raw;
@@ -6517,6 +6453,7 @@ function ScrollerOverlay(param) {
6517
6453
  var labelTextColor = (_ref11 = cfg === null || cfg === void 0 ? void 0 : cfg.label_text_color) !== null && _ref11 !== void 0 ? _ref11 : "#ffffff";
6518
6454
  var accentColor = (_ref12 = cfg === null || cfg === void 0 ? void 0 : cfg.accent_color) !== null && _ref12 !== void 0 ? _ref12 : labelColor;
6519
6455
  var showAccentLine = (cfg === null || cfg === void 0 ? void 0 : cfg.show_accent_line) !== false;
6456
+ var isEquitiesStrip = (cfg === null || cfg === void 0 ? void 0 : cfg.preset) === "equities_strip";
6520
6457
  var isHorizontal = direction === "left" || direction === "right";
6521
6458
  var isReverse = direction === "right" || direction === "down";
6522
6459
  var fullText = segments.join(" ".concat(sep, " "));
@@ -6547,7 +6484,7 @@ function ScrollerOverlay(param) {
6547
6484
  children: [
6548
6485
  showAccentLine && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
6549
6486
  style: {
6550
- height: 3,
6487
+ height: isEquitiesStrip ? 2 : 3,
6551
6488
  background: accentColor,
6552
6489
  flexShrink: 0,
6553
6490
  width: "100%"
@@ -6560,8 +6497,8 @@ function ScrollerOverlay(param) {
6560
6497
  overflow: "hidden",
6561
6498
  minHeight: 0,
6562
6499
  alignItems: "center",
6563
- padding: "".concat(Math.max(4, pad * 0.75), "px ").concat(pad, "px"),
6564
- gap: Math.max(6, pad),
6500
+ padding: isEquitiesStrip ? "".concat(Math.max(2, pad * 0.5), "px ").concat(pad, "px") : "".concat(Math.max(4, pad * 0.75), "px ").concat(pad, "px"),
6501
+ gap: isEquitiesStrip ? Math.max(4, Math.round(pad * 0.75)) : Math.max(6, pad),
6565
6502
  boxSizing: "border-box"
6566
6503
  },
6567
6504
  children: [
@@ -6569,30 +6506,33 @@ function ScrollerOverlay(param) {
6569
6506
  style: {
6570
6507
  background: labelColor,
6571
6508
  color: labelTextColor,
6572
- padding: "10px 14px",
6509
+ padding: isEquitiesStrip ? "6px 12px" : "10px 14px",
6573
6510
  display: "flex",
6574
- flexDirection: "column",
6511
+ flexDirection: isEquitiesStrip ? "row" : "column",
6575
6512
  alignItems: "center",
6576
6513
  justifyContent: "center",
6577
6514
  flexShrink: 0,
6578
6515
  textAlign: "center",
6579
- gap: 2,
6580
- borderRadius: Math.max(4, borderRadius > 0 ? borderRadius : 6),
6581
- boxShadow: "0 2px 8px rgba(0,0,0,0.35)"
6516
+ gap: isEquitiesStrip ? 0 : 2,
6517
+ borderRadius: Math.max(2, borderRadius > 0 ? borderRadius : 6),
6518
+ boxShadow: isEquitiesStrip ? "inset 0 1px 0 rgba(255,255,255,0.08)" : "0 2px 8px rgba(0,0,0,0.35)",
6519
+ alignSelf: "stretch",
6520
+ maxWidth: isEquitiesStrip ? "min(200px, 28%)" : void 0
6582
6521
  },
6583
6522
  children: [
6584
6523
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
6585
6524
  style: {
6586
- fontWeight: 800,
6587
- fontSize: "0.78em",
6588
- letterSpacing: "0.08em",
6589
- lineHeight: 1.15,
6590
- textTransform: "uppercase",
6591
- whiteSpace: "nowrap"
6525
+ fontWeight: isEquitiesStrip ? 700 : 800,
6526
+ fontSize: isEquitiesStrip ? "0.82em" : "0.78em",
6527
+ letterSpacing: isEquitiesStrip ? "0.04em" : "0.08em",
6528
+ lineHeight: 1.2,
6529
+ textTransform: isEquitiesStrip ? "none" : "uppercase",
6530
+ whiteSpace: isEquitiesStrip ? "normal" : "nowrap",
6531
+ textAlign: isEquitiesStrip ? "left" : "center"
6592
6532
  },
6593
6533
  children: label
6594
6534
  }),
6595
- labelLine2 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
6535
+ labelLine2 && !isEquitiesStrip && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
6596
6536
  style: {
6597
6537
  fontWeight: 600,
6598
6538
  fontSize: "0.58em",
@@ -6607,13 +6547,13 @@ function ScrollerOverlay(param) {
6607
6547
  }),
6608
6548
  label && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
6609
6549
  style: {
6610
- width: 2,
6550
+ width: isEquitiesStrip ? 1 : 2,
6611
6551
  alignSelf: "stretch",
6612
- minHeight: 24,
6552
+ minHeight: isEquitiesStrip ? 20 : 24,
6613
6553
  background: accentColor,
6614
6554
  flexShrink: 0,
6615
6555
  borderRadius: 1,
6616
- opacity: 0.9
6556
+ opacity: 0.85
6617
6557
  }
6618
6558
  }),
6619
6559
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
@@ -8087,30 +8027,7 @@ var StormcloudVideoPlayerComponent = import_react2.default.memo(function(props)
8087
8027
  swirlOverlayApiBaseUrl
8088
8028
  ]);
8089
8029
  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];
8090
- var displayOverlays = import_react2.default.useMemo(function() {
8091
- if (!swirlProjectId || !swirlShowcaseDemo) return overlays;
8092
- if (overlays.some(scrollerLooksLikeMarketsStock)) return overlays;
8093
- var hasOtherScroller = overlays.some(function(o) {
8094
- return o.type === "scroller";
8095
- });
8096
- var cw = overlayCoordSpace === null || overlayCoordSpace === void 0 ? void 0 : overlayCoordSpace.width;
8097
- var ch = overlayCoordSpace === null || overlayCoordSpace === void 0 ? void 0 : overlayCoordSpace.height;
8098
- var tickerOpts = cw && cw > 0 && ch && ch > 0 ? {
8099
- stackAboveNews: hasOtherScroller,
8100
- coordinateWidth: cw,
8101
- coordinateHeight: ch
8102
- } : {
8103
- stackAboveNews: hasOtherScroller
8104
- };
8105
- return _to_consumable_array(overlays).concat([
8106
- createDemoStockTickerOverlay(swirlProjectId, tickerOpts)
8107
- ]);
8108
- }, [
8109
- overlays,
8110
- swirlProjectId,
8111
- swirlShowcaseDemo,
8112
- overlayCoordSpace
8113
- ]);
8030
+ var displayOverlays = overlays;
8114
8031
  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];
8115
8032
  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];
8116
8033
  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];
@@ -11505,7 +11422,6 @@ var StormcloudPlayer_default = StormcloudPlayer;
11505
11422
  StormcloudVideoPlayerComponent: StormcloudVideoPlayerComponent,
11506
11423
  canPlay: canPlay,
11507
11424
  createAdStormPlayer: createAdStormPlayer,
11508
- createDemoStockTickerOverlay: createDemoStockTickerOverlay,
11509
11425
  createStormcloudPlayer: createStormcloudPlayer,
11510
11426
  detectBrowser: detectBrowser,
11511
11427
  fetchProjectOverlays: fetchProjectOverlays,
@@ -11526,7 +11442,6 @@ var StormcloudPlayer_default = StormcloudPlayer;
11526
11442
  players: players,
11527
11443
  randomString: randomString,
11528
11444
  resolveImageUrl: resolveImageUrl,
11529
- scrollerLooksLikeMarketsStock: scrollerLooksLikeMarketsStock,
11530
11445
  sendHeartbeat: sendHeartbeat,
11531
11446
  sendInitialTracking: sendInitialTracking,
11532
11447
  supportsFeature: supportsFeature,