stormcloud-video-player 0.7.41 → 0.7.43
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 +141 -143
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +1 -7
- package/lib/index.d.ts +1 -7
- package/lib/index.js +142 -136
- package/lib/index.js.map +1 -1
- package/lib/ui/OverlayRenderer.cjs +140 -57
- package/lib/ui/OverlayRenderer.cjs.map +1 -1
- package/lib/ui/StormcloudVideoPlayer.cjs +141 -135
- package/lib/ui/StormcloudVideoPlayer.cjs.map +1 -1
- package/lib/utils/overlays.cjs +6 -83
- package/lib/utils/overlays.cjs.map +1 -1
- package/lib/utils/overlays.d.cts +1 -7
- package/package.json +1 -1
|
@@ -5693,28 +5693,16 @@ var SWIRL_HD_AUTHORING_WIDTH = 1920;
|
|
|
5693
5693
|
var SWIRL_HD_AUTHORING_HEIGHT = 1080;
|
|
5694
5694
|
var NAB_DEMO_NAME_PREFIX = "NAB Demo \u2014 ";
|
|
5695
5695
|
function overlayAuthoringDimensions(overlay, decodeWidth, decodeHeight) {
|
|
5696
|
-
if (
|
|
5697
|
-
return {
|
|
5698
|
-
width: decodeWidth || SWIRL_HD_AUTHORING_WIDTH,
|
|
5699
|
-
height: decodeHeight || SWIRL_HD_AUTHORING_HEIGHT
|
|
5700
|
-
};
|
|
5701
|
-
}
|
|
5702
|
-
if (!overlay.visible) {
|
|
5696
|
+
if (overlay.name.startsWith(NAB_DEMO_NAME_PREFIX)) {
|
|
5703
5697
|
return {
|
|
5704
|
-
width:
|
|
5705
|
-
height:
|
|
5698
|
+
width: SWIRL_HD_AUTHORING_WIDTH,
|
|
5699
|
+
height: SWIRL_HD_AUTHORING_HEIGHT
|
|
5706
5700
|
};
|
|
5707
5701
|
}
|
|
5708
|
-
|
|
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)) {
|
|
5702
|
+
if (!decodeWidth || !decodeHeight) {
|
|
5715
5703
|
return {
|
|
5716
|
-
width: SWIRL_HD_AUTHORING_WIDTH,
|
|
5717
|
-
height: SWIRL_HD_AUTHORING_HEIGHT
|
|
5704
|
+
width: decodeWidth || SWIRL_HD_AUTHORING_WIDTH,
|
|
5705
|
+
height: decodeHeight || SWIRL_HD_AUTHORING_HEIGHT
|
|
5718
5706
|
};
|
|
5719
5707
|
}
|
|
5720
5708
|
return {
|
|
@@ -5809,63 +5797,6 @@ function inferSwirlOverlayCoordinateSpace(overlays, videoWidth, videoHeight) {
|
|
|
5809
5797
|
height: videoHeight
|
|
5810
5798
|
};
|
|
5811
5799
|
}
|
|
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 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));
|
|
5831
|
-
return {
|
|
5832
|
-
id: -9001,
|
|
5833
|
-
project_id: projectId,
|
|
5834
|
-
name: "Demo stock ticker",
|
|
5835
|
-
type: "scroller",
|
|
5836
|
-
visible: true,
|
|
5837
|
-
x: x,
|
|
5838
|
-
y: y,
|
|
5839
|
-
width: width,
|
|
5840
|
-
height: height,
|
|
5841
|
-
opacity: 100,
|
|
5842
|
-
start_time: "00:00:00.000",
|
|
5843
|
-
duration: "24:00:00.000",
|
|
5844
|
-
z_index: 120,
|
|
5845
|
-
scroller_config: {
|
|
5846
|
-
preset: "equities_strip",
|
|
5847
|
-
use_custom_text: true,
|
|
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%",
|
|
5849
|
-
direction: "left",
|
|
5850
|
-
scroll_speed: scrollSpeed,
|
|
5851
|
-
font_size: fontSize,
|
|
5852
|
-
font_weight: "600",
|
|
5853
|
-
text_color: "#e2e8f0",
|
|
5854
|
-
background_color: "#0a0f18",
|
|
5855
|
-
background_opacity: 92,
|
|
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",
|
|
5862
|
-
accent_color: "#38bdf8",
|
|
5863
|
-
show_accent_line: true,
|
|
5864
|
-
separator_char: "\u2022",
|
|
5865
|
-
item_spacing: Math.max(28, Math.round(48 * sx))
|
|
5866
|
-
}
|
|
5867
|
-
};
|
|
5868
|
-
}
|
|
5869
5800
|
function normalizeScrollerConfig(raw) {
|
|
5870
5801
|
if (!raw || (typeof raw === "undefined" ? "undefined" : _type_of(raw)) !== "object") return void 0;
|
|
5871
5802
|
var r = raw;
|
|
@@ -7365,11 +7296,19 @@ function hexToRgb(hex) {
|
|
|
7365
7296
|
return "".concat(num >> 16 & 255, ",").concat(num >> 8 & 255, ",").concat(num & 255);
|
|
7366
7297
|
}
|
|
7367
7298
|
var FADE_DURATION_MS = 1e3;
|
|
7368
|
-
var SHOWCASE_CYCLE_MS_DEFAULT =
|
|
7369
|
-
var
|
|
7370
|
-
var
|
|
7371
|
-
var
|
|
7372
|
-
var
|
|
7299
|
+
var SHOWCASE_CYCLE_MS_DEFAULT = 36e3;
|
|
7300
|
+
var SHOWCASE_MIN_BEAT_MS = 6e3;
|
|
7301
|
+
var BEAT_POP_IN_MS = 520;
|
|
7302
|
+
var BEAT_POP_OUT_MS = 520;
|
|
7303
|
+
var SHOWCASE_PERSISTENT_TYPES = /* @__PURE__ */ new Set([
|
|
7304
|
+
"scroller",
|
|
7305
|
+
"breaking_news",
|
|
7306
|
+
"image",
|
|
7307
|
+
"text",
|
|
7308
|
+
"shape",
|
|
7309
|
+
"countdown",
|
|
7310
|
+
"qr_code"
|
|
7311
|
+
]);
|
|
7373
7312
|
function easeOutCubic(t) {
|
|
7374
7313
|
var u = 1 - t;
|
|
7375
7314
|
return 1 - u * u * u;
|
|
@@ -7382,38 +7321,108 @@ function easeOutBack(t) {
|
|
|
7382
7321
|
var c3 = c1 + 1;
|
|
7383
7322
|
return 1 + c3 * Math.pow(t - 1, 3) + c1 * Math.pow(t - 1, 2);
|
|
7384
7323
|
}
|
|
7385
|
-
function
|
|
7386
|
-
if (phase <
|
|
7387
|
-
|
|
7388
|
-
|
|
7324
|
+
function beatOpacity(phase, beatMs) {
|
|
7325
|
+
if (phase < BEAT_POP_IN_MS) return easeOutCubic(phase / BEAT_POP_IN_MS);
|
|
7326
|
+
var holdEnd = beatMs - BEAT_POP_OUT_MS;
|
|
7327
|
+
if (phase >= holdEnd) {
|
|
7328
|
+
return Math.max(0, 1 - easeInCubic((phase - holdEnd) / BEAT_POP_OUT_MS));
|
|
7389
7329
|
}
|
|
7390
7330
|
return 1;
|
|
7391
7331
|
}
|
|
7392
|
-
function
|
|
7393
|
-
if (phase <
|
|
7394
|
-
return Math.min(1, 0.
|
|
7332
|
+
function beatScale(phase, beatMs) {
|
|
7333
|
+
if (phase < BEAT_POP_IN_MS) {
|
|
7334
|
+
return Math.min(1, 0.92 + 0.08 * easeOutBack(phase / BEAT_POP_IN_MS));
|
|
7395
7335
|
}
|
|
7396
|
-
|
|
7397
|
-
|
|
7336
|
+
var holdEnd = beatMs - BEAT_POP_OUT_MS;
|
|
7337
|
+
if (phase >= holdEnd) {
|
|
7338
|
+
return 1 - 0.06 * easeInCubic((phase - holdEnd) / BEAT_POP_OUT_MS);
|
|
7398
7339
|
}
|
|
7399
7340
|
return 1;
|
|
7400
7341
|
}
|
|
7401
|
-
function
|
|
7402
|
-
var
|
|
7342
|
+
function partitionShowcase(overlays) {
|
|
7343
|
+
var visible = overlays.filter(function(o) {
|
|
7344
|
+
return o.visible;
|
|
7345
|
+
});
|
|
7346
|
+
var persistent = [];
|
|
7347
|
+
var spotlight = [];
|
|
7348
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
7349
|
+
try {
|
|
7350
|
+
for(var _iterator = visible[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
7351
|
+
var o = _step.value;
|
|
7352
|
+
if (SHOWCASE_PERSISTENT_TYPES.has(o.type)) persistent.push(o);
|
|
7353
|
+
else spotlight.push(o);
|
|
7354
|
+
}
|
|
7355
|
+
} catch (err) {
|
|
7356
|
+
_didIteratorError = true;
|
|
7357
|
+
_iteratorError = err;
|
|
7358
|
+
} finally{
|
|
7359
|
+
try {
|
|
7360
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
7361
|
+
_iterator.return();
|
|
7362
|
+
}
|
|
7363
|
+
} finally{
|
|
7364
|
+
if (_didIteratorError) {
|
|
7365
|
+
throw _iteratorError;
|
|
7366
|
+
}
|
|
7367
|
+
}
|
|
7368
|
+
}
|
|
7369
|
+
spotlight.sort(function(a, b) {
|
|
7370
|
+
return a.z_index - b.z_index || a.id - b.id;
|
|
7371
|
+
});
|
|
7372
|
+
var beats = [];
|
|
7373
|
+
var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;
|
|
7374
|
+
try {
|
|
7375
|
+
for(var _iterator1 = spotlight[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true){
|
|
7376
|
+
var o1 = _step1.value;
|
|
7377
|
+
beats.push([
|
|
7378
|
+
o1
|
|
7379
|
+
]);
|
|
7380
|
+
}
|
|
7381
|
+
} catch (err) {
|
|
7382
|
+
_didIteratorError1 = true;
|
|
7383
|
+
_iteratorError1 = err;
|
|
7384
|
+
} finally{
|
|
7385
|
+
try {
|
|
7386
|
+
if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
|
|
7387
|
+
_iterator1.return();
|
|
7388
|
+
}
|
|
7389
|
+
} finally{
|
|
7390
|
+
if (_didIteratorError1) {
|
|
7391
|
+
throw _iteratorError1;
|
|
7392
|
+
}
|
|
7393
|
+
}
|
|
7394
|
+
}
|
|
7395
|
+
return {
|
|
7396
|
+
persistent: persistent,
|
|
7397
|
+
beats: beats
|
|
7398
|
+
};
|
|
7399
|
+
}
|
|
7400
|
+
function useShowcaseBeat(enabled, cycleMs, beats) {
|
|
7401
|
+
var safeBeats = Math.max(1, beats);
|
|
7402
|
+
var beatMs = Math.max(SHOWCASE_MIN_BEAT_MS, Math.floor(cycleMs / safeBeats));
|
|
7403
|
+
var totalMs = beatMs * safeBeats;
|
|
7404
|
+
var _ref = _sliced_to_array((0, import_react.useState)(function() {
|
|
7405
|
+
return Date.now();
|
|
7406
|
+
}), 2), now = _ref[0], setNow = _ref[1];
|
|
7403
7407
|
(0, import_react.useEffect)(function() {
|
|
7404
7408
|
if (!enabled) return;
|
|
7405
|
-
setPhase(Date.now() % cycleMs);
|
|
7406
7409
|
var id = window.setInterval(function() {
|
|
7407
|
-
|
|
7408
|
-
},
|
|
7410
|
+
return setNow(Date.now());
|
|
7411
|
+
}, 64);
|
|
7409
7412
|
return function() {
|
|
7410
7413
|
return clearInterval(id);
|
|
7411
7414
|
};
|
|
7412
7415
|
}, [
|
|
7413
|
-
enabled
|
|
7414
|
-
cycleMs
|
|
7416
|
+
enabled
|
|
7415
7417
|
]);
|
|
7416
|
-
|
|
7418
|
+
var phase = now % totalMs;
|
|
7419
|
+
var beatIndex = Math.min(safeBeats - 1, Math.floor(phase / beatMs));
|
|
7420
|
+
var beatPhase = phase - beatIndex * beatMs;
|
|
7421
|
+
return {
|
|
7422
|
+
beatIndex: beatIndex,
|
|
7423
|
+
beatPhase: beatPhase,
|
|
7424
|
+
beatMs: beatMs
|
|
7425
|
+
};
|
|
7417
7426
|
}
|
|
7418
7427
|
var OverlayRenderer = function OverlayRenderer(param) {
|
|
7419
7428
|
var overlays = param.overlays, currentTime = param.currentTime, videoRef = param.videoRef, coordinateSpace = param.coordinateSpace, _param_showcaseMode = param.showcaseMode, showcaseMode = _param_showcaseMode === void 0 ? false : _param_showcaseMode, _param_showcaseCycleMs = param.showcaseCycleMs, showcaseCycleMs = _param_showcaseCycleMs === void 0 ? SHOWCASE_CYCLE_MS_DEFAULT : _param_showcaseCycleMs;
|
|
@@ -7421,7 +7430,28 @@ var OverlayRenderer = function OverlayRenderer(param) {
|
|
|
7421
7430
|
var rafRef = (0, import_react.useRef)(null);
|
|
7422
7431
|
var _ref1 = _sliced_to_array((0, import_react.useState)(/* @__PURE__ */ new Map()), 2), fadeMap = _ref1[0], setFadeMap = _ref1[1];
|
|
7423
7432
|
var removeTimers = (0, import_react.useRef)(/* @__PURE__ */ new Map());
|
|
7424
|
-
var
|
|
7433
|
+
var _ref2 = (0, import_react.useMemo)(function() {
|
|
7434
|
+
return partitionShowcase(overlays);
|
|
7435
|
+
}, [
|
|
7436
|
+
overlays
|
|
7437
|
+
]), showcasePersistent = _ref2.persistent, showcaseBeats = _ref2.beats;
|
|
7438
|
+
var _useShowcaseBeat = useShowcaseBeat(showcaseMode, showcaseCycleMs, showcaseBeats.length), showcaseBeatIndex = _useShowcaseBeat.beatIndex, showcaseBeatPhase = _useShowcaseBeat.beatPhase, showcaseBeatMs = _useShowcaseBeat.beatMs;
|
|
7439
|
+
var showcasePersistentIds = (0, import_react.useMemo)(function() {
|
|
7440
|
+
return new Set(showcasePersistent.map(function(o) {
|
|
7441
|
+
return o.id;
|
|
7442
|
+
}));
|
|
7443
|
+
}, [
|
|
7444
|
+
showcasePersistent
|
|
7445
|
+
]);
|
|
7446
|
+
var showcaseSpotlightIds = (0, import_react.useMemo)(function() {
|
|
7447
|
+
var beat = showcaseBeats[showcaseBeatIndex];
|
|
7448
|
+
return new Set((beat !== null && beat !== void 0 ? beat : []).map(function(o) {
|
|
7449
|
+
return o.id;
|
|
7450
|
+
}));
|
|
7451
|
+
}, [
|
|
7452
|
+
showcaseBeats,
|
|
7453
|
+
showcaseBeatIndex
|
|
7454
|
+
]);
|
|
7425
7455
|
var updateDims = (0, import_react.useCallback)(function() {
|
|
7426
7456
|
var video = videoRef.current;
|
|
7427
7457
|
if (video) {
|
|
@@ -7454,10 +7484,9 @@ var OverlayRenderer = function OverlayRenderer(param) {
|
|
|
7454
7484
|
]);
|
|
7455
7485
|
var activeOverlays = (0, import_react.useMemo)(function() {
|
|
7456
7486
|
if (showcaseMode) {
|
|
7457
|
-
|
|
7458
|
-
|
|
7459
|
-
|
|
7460
|
-
});
|
|
7487
|
+
var _showcaseBeats_showcaseBeatIndex;
|
|
7488
|
+
var beat = (_showcaseBeats_showcaseBeatIndex = showcaseBeats[showcaseBeatIndex]) !== null && _showcaseBeats_showcaseBeatIndex !== void 0 ? _showcaseBeats_showcaseBeatIndex : [];
|
|
7489
|
+
return _to_consumable_array(showcasePersistent).concat(_to_consumable_array(beat));
|
|
7461
7490
|
}
|
|
7462
7491
|
return overlays.filter(function(o) {
|
|
7463
7492
|
return isOverlayActive(o, currentTime);
|
|
@@ -7466,14 +7495,9 @@ var OverlayRenderer = function OverlayRenderer(param) {
|
|
|
7466
7495
|
overlays,
|
|
7467
7496
|
currentTime,
|
|
7468
7497
|
showcaseMode,
|
|
7469
|
-
|
|
7470
|
-
|
|
7471
|
-
|
|
7472
|
-
return new Set(activeOverlays.map(function(o) {
|
|
7473
|
-
return o.id;
|
|
7474
|
-
}));
|
|
7475
|
-
}, [
|
|
7476
|
-
activeOverlays
|
|
7498
|
+
showcasePersistent,
|
|
7499
|
+
showcaseBeats,
|
|
7500
|
+
showcaseBeatIndex
|
|
7477
7501
|
]);
|
|
7478
7502
|
(0, import_react.useLayoutEffect)(function() {
|
|
7479
7503
|
var activeIds = new Set(activeOverlays.map(function(o) {
|
|
@@ -7668,10 +7692,12 @@ var OverlayRenderer = function OverlayRenderer(param) {
|
|
|
7668
7692
|
var width = overlay.width * scaleX;
|
|
7669
7693
|
var height = overlay.height * scaleY;
|
|
7670
7694
|
var baseOpacity = Math.max(0, Math.min(100, overlay.opacity)) / 100;
|
|
7671
|
-
var
|
|
7672
|
-
var
|
|
7673
|
-
var
|
|
7674
|
-
var
|
|
7695
|
+
var isShowcasePersistent = showcaseMode && showcasePersistentIds.has(overlay.id);
|
|
7696
|
+
var isShowcaseSpotlight = showcaseMode && showcaseSpotlightIds.has(overlay.id);
|
|
7697
|
+
var isShowcaseDormant = showcaseMode && !isShowcasePersistent && !isShowcaseSpotlight;
|
|
7698
|
+
var useShowcasePop = isShowcaseSpotlight;
|
|
7699
|
+
var opacity = useShowcasePop ? baseOpacity * beatOpacity(showcaseBeatPhase, showcaseBeatMs) : isShowcaseDormant ? 0 : visible ? baseOpacity : 0;
|
|
7700
|
+
var popScale = useShowcasePop ? beatScale(showcaseBeatPhase, showcaseBeatMs) : 1;
|
|
7675
7701
|
var sz = {
|
|
7676
7702
|
w: width,
|
|
7677
7703
|
h: height
|
|
@@ -7886,27 +7912,7 @@ var StormcloudVideoPlayerComponent = import_react2.default.memo(function(props)
|
|
|
7886
7912
|
swirlOverlayApiBaseUrl
|
|
7887
7913
|
]);
|
|
7888
7914
|
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];
|
|
7889
|
-
var displayOverlays =
|
|
7890
|
-
if (!swirlProjectId || !swirlShowcaseDemo) return overlays;
|
|
7891
|
-
if (overlays.some(scrollerLooksLikeMarketsStock)) return overlays;
|
|
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
|
-
} : {};
|
|
7901
|
-
return _to_consumable_array(overlays).concat([
|
|
7902
|
-
createDemoStockTickerOverlay(swirlProjectId, tickerOpts)
|
|
7903
|
-
]);
|
|
7904
|
-
}, [
|
|
7905
|
-
overlays,
|
|
7906
|
-
swirlProjectId,
|
|
7907
|
-
swirlShowcaseDemo,
|
|
7908
|
-
overlayCoordSpace
|
|
7909
|
-
]);
|
|
7915
|
+
var displayOverlays = overlays;
|
|
7910
7916
|
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];
|
|
7911
7917
|
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];
|
|
7912
7918
|
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];
|