stormcloud-video-player 0.7.0 → 0.7.1

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.js CHANGED
@@ -6135,7 +6135,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
6135
6135
  // src/ui/StormcloudVideoPlayer.tsx
6136
6136
  import { FaPlay, FaPause, FaVolumeUp, FaVolumeMute, FaVolumeDown, FaExpand, FaCompress, FaSpinner } from "react-icons/fa";
6137
6137
  // src/ui/OverlayRenderer.tsx
6138
- import { useEffect, useRef, useState, useCallback } from "react";
6138
+ import React, { useEffect, useRef, useState, useCallback } from "react";
6139
6139
  // src/utils/overlays.ts
6140
6140
  var OVERLAY_API_BASE = "https://adstorm.co/api-adstorm-dev";
6141
6141
  function timeStringToSeconds(timeStr) {
@@ -6358,6 +6358,751 @@ function ScrollerOverlay(param) {
6358
6358
  ]
6359
6359
  });
6360
6360
  }
6361
+ function parseConfig(content) {
6362
+ if (!content) return null;
6363
+ try {
6364
+ return JSON.parse(content);
6365
+ } catch (unused) {
6366
+ return null;
6367
+ }
6368
+ }
6369
+ function ScoreBugOverlay(param) {
6370
+ var overlay = param.overlay, size = param.size;
6371
+ var cfg = parseConfig(overlay.content);
6372
+ if (!cfg) return null;
6373
+ var f = Math.max(6, size.w * 0.058);
6374
+ return /* @__PURE__ */ jsxs("div", {
6375
+ style: {
6376
+ width: "100%",
6377
+ height: "100%",
6378
+ borderRadius: Math.max(2, size.w * 0.035),
6379
+ display: "flex",
6380
+ flexDirection: "column",
6381
+ background: cfg.backgroundColor,
6382
+ color: cfg.textColor,
6383
+ fontFamily: "Roboto, 'Segoe UI', Arial, sans-serif",
6384
+ overflow: "hidden",
6385
+ pointerEvents: "none",
6386
+ userSelect: "none",
6387
+ fontSize: "".concat(f, "px")
6388
+ },
6389
+ children: [
6390
+ /* @__PURE__ */ jsxs("div", {
6391
+ style: {
6392
+ flex: 1,
6393
+ display: "flex",
6394
+ alignItems: "center",
6395
+ padding: "0 ".concat(f * 0.8, "px"),
6396
+ gap: f * 0.4
6397
+ },
6398
+ children: [
6399
+ /* @__PURE__ */ jsxs("div", {
6400
+ style: {
6401
+ flex: 1,
6402
+ textAlign: "center"
6403
+ },
6404
+ children: [
6405
+ /* @__PURE__ */ jsx("div", {
6406
+ style: {
6407
+ fontSize: "1em",
6408
+ fontWeight: 700
6409
+ },
6410
+ children: cfg.homeTeam
6411
+ }),
6412
+ /* @__PURE__ */ jsx("div", {
6413
+ style: {
6414
+ fontSize: "1.8em",
6415
+ fontWeight: 900,
6416
+ lineHeight: 1
6417
+ },
6418
+ children: cfg.homeScore
6419
+ })
6420
+ ]
6421
+ }),
6422
+ /* @__PURE__ */ jsxs("div", {
6423
+ style: {
6424
+ fontSize: "0.8em",
6425
+ textAlign: "center",
6426
+ opacity: 0.7,
6427
+ padding: "0 ".concat(f * 0.4, "px")
6428
+ },
6429
+ children: [
6430
+ /* @__PURE__ */ jsx("div", {
6431
+ children: cfg.period
6432
+ }),
6433
+ /* @__PURE__ */ jsx("div", {
6434
+ children: cfg.clock
6435
+ })
6436
+ ]
6437
+ }),
6438
+ /* @__PURE__ */ jsxs("div", {
6439
+ style: {
6440
+ flex: 1,
6441
+ textAlign: "center"
6442
+ },
6443
+ children: [
6444
+ /* @__PURE__ */ jsx("div", {
6445
+ style: {
6446
+ fontSize: "1em",
6447
+ fontWeight: 700
6448
+ },
6449
+ children: cfg.awayTeam
6450
+ }),
6451
+ /* @__PURE__ */ jsx("div", {
6452
+ style: {
6453
+ fontSize: "1.8em",
6454
+ fontWeight: 900,
6455
+ lineHeight: 1
6456
+ },
6457
+ children: cfg.awayScore
6458
+ })
6459
+ ]
6460
+ })
6461
+ ]
6462
+ }),
6463
+ cfg.sponsorText && /* @__PURE__ */ jsx("div", {
6464
+ style: {
6465
+ fontSize: "0.7em",
6466
+ textAlign: "center",
6467
+ opacity: 0.5,
6468
+ padding: "".concat(f * 0.2, "px 0"),
6469
+ borderTop: "1px solid ".concat(cfg.accentColor, "40")
6470
+ },
6471
+ children: cfg.sponsorText
6472
+ })
6473
+ ]
6474
+ });
6475
+ }
6476
+ function LowerThirdOverlay(param) {
6477
+ var overlay = param.overlay, size = param.size;
6478
+ var cfg = parseConfig(overlay.content);
6479
+ if (!cfg) return null;
6480
+ var f = Math.max(6, size.w * 0.055);
6481
+ return /* @__PURE__ */ jsxs("div", {
6482
+ style: {
6483
+ width: "100%",
6484
+ height: "100%",
6485
+ borderRadius: Math.max(2, size.w * 0.02),
6486
+ display: "flex",
6487
+ flexDirection: "column",
6488
+ justifyContent: "flex-end",
6489
+ background: cfg.backgroundColor,
6490
+ color: cfg.textColor,
6491
+ fontFamily: "Roboto, 'Segoe UI', Arial, sans-serif",
6492
+ overflow: "hidden",
6493
+ pointerEvents: "none",
6494
+ userSelect: "none",
6495
+ fontSize: "".concat(f, "px")
6496
+ },
6497
+ children: [
6498
+ /* @__PURE__ */ jsx("div", {
6499
+ style: {
6500
+ width: "100%",
6501
+ height: Math.max(2, size.h * 0.06),
6502
+ backgroundColor: cfg.accentColor
6503
+ }
6504
+ }),
6505
+ /* @__PURE__ */ jsxs("div", {
6506
+ style: {
6507
+ flex: 1,
6508
+ display: "flex",
6509
+ flexDirection: "column",
6510
+ justifyContent: "center",
6511
+ padding: "".concat(f * 0.5, "px ").concat(f * 1.2, "px")
6512
+ },
6513
+ children: [
6514
+ /* @__PURE__ */ jsx("div", {
6515
+ style: {
6516
+ fontSize: "1.4em",
6517
+ fontWeight: 700,
6518
+ lineHeight: 1.2,
6519
+ textShadow: "0 1px 4px rgba(0,0,0,0.5)"
6520
+ },
6521
+ children: cfg.headline
6522
+ }),
6523
+ /* @__PURE__ */ jsx("div", {
6524
+ style: {
6525
+ fontSize: "1em",
6526
+ opacity: 0.7,
6527
+ marginTop: f * 0.2
6528
+ },
6529
+ children: cfg.subtitle
6530
+ })
6531
+ ]
6532
+ }),
6533
+ cfg.sponsorText && /* @__PURE__ */ jsx("div", {
6534
+ style: {
6535
+ fontSize: "0.7em",
6536
+ opacity: 0.4,
6537
+ padding: "0 ".concat(f * 1.2, "px ").concat(f * 0.4, "px")
6538
+ },
6539
+ children: cfg.sponsorText
6540
+ })
6541
+ ]
6542
+ });
6543
+ }
6544
+ function QrCodeOverlay(param) {
6545
+ var overlay = param.overlay, size = param.size;
6546
+ var cfg = parseConfig(overlay.content);
6547
+ if (!cfg) return null;
6548
+ var qrSide = Math.max(32, Math.min(size.w, size.h) * 0.55);
6549
+ var qrUrl = "https://api.qrserver.com/v1/create-qr-code/?size=".concat(Math.round(qrSide * 2), "x").concat(Math.round(qrSide * 2), "&data=").concat(encodeURIComponent(cfg.url || "https://example.com"));
6550
+ var f = Math.max(6, size.w * 0.06);
6551
+ return /* @__PURE__ */ jsxs("div", {
6552
+ style: {
6553
+ width: "100%",
6554
+ height: "100%",
6555
+ borderRadius: Math.max(2, size.w * 0.035),
6556
+ display: "flex",
6557
+ flexDirection: "column",
6558
+ alignItems: "center",
6559
+ justifyContent: "center",
6560
+ gap: f * 0.4,
6561
+ background: cfg.backgroundColor,
6562
+ color: cfg.textColor,
6563
+ fontFamily: "Roboto, 'Segoe UI', Arial, sans-serif",
6564
+ padding: f * 0.6,
6565
+ boxSizing: "border-box",
6566
+ pointerEvents: "none",
6567
+ userSelect: "none",
6568
+ overflow: "hidden"
6569
+ },
6570
+ children: [
6571
+ /* @__PURE__ */ jsx("div", {
6572
+ style: {
6573
+ flexShrink: 0,
6574
+ background: "#fff",
6575
+ borderRadius: Math.max(2, qrSide * 0.06),
6576
+ padding: Math.max(2, qrSide * 0.06),
6577
+ lineHeight: 0
6578
+ },
6579
+ children: /* @__PURE__ */ jsx("img", {
6580
+ src: qrUrl,
6581
+ alt: "QR Code",
6582
+ style: {
6583
+ width: "".concat(qrSide, "px"),
6584
+ height: "".concat(qrSide, "px"),
6585
+ display: "block"
6586
+ }
6587
+ })
6588
+ }),
6589
+ /* @__PURE__ */ jsx("div", {
6590
+ style: {
6591
+ fontSize: "".concat(f * 1.1, "px"),
6592
+ fontWeight: 700,
6593
+ textAlign: "center",
6594
+ color: cfg.accentColor,
6595
+ overflow: "hidden",
6596
+ textOverflow: "ellipsis",
6597
+ whiteSpace: "nowrap",
6598
+ width: "100%"
6599
+ },
6600
+ children: cfg.ctaText
6601
+ }),
6602
+ cfg.description && /* @__PURE__ */ jsx("div", {
6603
+ style: {
6604
+ fontSize: "".concat(f * 0.75, "px"),
6605
+ opacity: 0.6,
6606
+ textAlign: "center",
6607
+ overflow: "hidden",
6608
+ textOverflow: "ellipsis",
6609
+ whiteSpace: "nowrap",
6610
+ width: "100%"
6611
+ },
6612
+ children: cfg.description
6613
+ })
6614
+ ]
6615
+ });
6616
+ }
6617
+ function ComingUpNextOverlay(param) {
6618
+ var overlay = param.overlay, size = param.size;
6619
+ var cfg = parseConfig(overlay.content);
6620
+ if (!cfg) return null;
6621
+ var f = Math.max(6, size.w * 0.05);
6622
+ return /* @__PURE__ */ jsxs("div", {
6623
+ style: {
6624
+ width: "100%",
6625
+ height: "100%",
6626
+ borderRadius: Math.max(2, size.w * 0.035),
6627
+ display: "flex",
6628
+ background: cfg.backgroundColor,
6629
+ color: cfg.textColor,
6630
+ fontFamily: "Roboto, 'Segoe UI', Arial, sans-serif",
6631
+ overflow: "hidden",
6632
+ pointerEvents: "none",
6633
+ userSelect: "none",
6634
+ fontSize: "".concat(f, "px")
6635
+ },
6636
+ children: [
6637
+ /* @__PURE__ */ jsx("div", {
6638
+ style: {
6639
+ width: Math.max(2, size.w * 0.015),
6640
+ flexShrink: 0,
6641
+ backgroundColor: cfg.accentColor
6642
+ }
6643
+ }),
6644
+ /* @__PURE__ */ jsxs("div", {
6645
+ style: {
6646
+ flex: 1,
6647
+ display: "flex",
6648
+ flexDirection: "column",
6649
+ justifyContent: "center",
6650
+ padding: "".concat(f * 0.6, "px ").concat(f * 1, "px"),
6651
+ minWidth: 0
6652
+ },
6653
+ children: [
6654
+ /* @__PURE__ */ jsx("div", {
6655
+ style: {
6656
+ fontSize: "0.8em",
6657
+ fontWeight: 600,
6658
+ textTransform: "uppercase",
6659
+ letterSpacing: "0.05em",
6660
+ color: cfg.accentColor
6661
+ },
6662
+ children: "Coming Up Next"
6663
+ }),
6664
+ /* @__PURE__ */ jsx("div", {
6665
+ style: {
6666
+ fontSize: "1.5em",
6667
+ fontWeight: 700,
6668
+ lineHeight: 1.2,
6669
+ marginTop: f * 0.2,
6670
+ overflow: "hidden",
6671
+ textOverflow: "ellipsis",
6672
+ whiteSpace: "nowrap"
6673
+ },
6674
+ children: cfg.title
6675
+ }),
6676
+ /* @__PURE__ */ jsx("div", {
6677
+ style: {
6678
+ fontSize: "0.9em",
6679
+ opacity: 0.6,
6680
+ overflow: "hidden",
6681
+ textOverflow: "ellipsis",
6682
+ whiteSpace: "nowrap"
6683
+ },
6684
+ children: cfg.subtitle
6685
+ }),
6686
+ cfg.scheduledTime && /* @__PURE__ */ jsx("div", {
6687
+ style: {
6688
+ fontSize: "1em",
6689
+ fontWeight: 600,
6690
+ marginTop: f * 0.4,
6691
+ color: cfg.accentColor
6692
+ },
6693
+ children: cfg.scheduledTime
6694
+ })
6695
+ ]
6696
+ })
6697
+ ]
6698
+ });
6699
+ }
6700
+ function ContextualTriggerOverlay(param) {
6701
+ var overlay = param.overlay, size = param.size;
6702
+ var cfg = parseConfig(overlay.content);
6703
+ if (!cfg) return null;
6704
+ var icons = {
6705
+ alert: "\u26A0\uFE0F",
6706
+ celebration: "\uD83C\uDF89",
6707
+ info: "\u2139\uFE0F",
6708
+ warning: "\uD83D\uDD14"
6709
+ };
6710
+ var f = Math.max(6, size.w * 0.05);
6711
+ return /* @__PURE__ */ jsxs("div", {
6712
+ style: {
6713
+ width: "100%",
6714
+ height: "100%",
6715
+ borderRadius: Math.max(2, size.w * 0.035),
6716
+ display: "flex",
6717
+ alignItems: "center",
6718
+ gap: f * 0.8,
6719
+ padding: "0 ".concat(f * 1.2, "px"),
6720
+ background: cfg.backgroundColor,
6721
+ color: cfg.textColor,
6722
+ fontFamily: "Roboto, 'Segoe UI', Arial, sans-serif",
6723
+ borderLeft: "".concat(Math.max(2, size.w * 0.02), "px solid ").concat(cfg.accentColor),
6724
+ boxSizing: "border-box",
6725
+ pointerEvents: "none",
6726
+ userSelect: "none",
6727
+ fontSize: "".concat(f, "px")
6728
+ },
6729
+ children: [
6730
+ /* @__PURE__ */ jsx("span", {
6731
+ style: {
6732
+ fontSize: "2em",
6733
+ flexShrink: 0
6734
+ },
6735
+ children: icons[cfg.iconType] || "\u26A1"
6736
+ }),
6737
+ /* @__PURE__ */ jsxs("div", {
6738
+ style: {
6739
+ flex: 1,
6740
+ minWidth: 0
6741
+ },
6742
+ children: [
6743
+ /* @__PURE__ */ jsx("div", {
6744
+ style: {
6745
+ fontSize: "1.3em",
6746
+ fontWeight: 700,
6747
+ overflow: "hidden",
6748
+ textOverflow: "ellipsis",
6749
+ whiteSpace: "nowrap"
6750
+ },
6751
+ children: cfg.headline
6752
+ }),
6753
+ /* @__PURE__ */ jsx("div", {
6754
+ style: {
6755
+ fontSize: "0.9em",
6756
+ opacity: 0.7,
6757
+ overflow: "hidden",
6758
+ textOverflow: "ellipsis",
6759
+ whiteSpace: "nowrap"
6760
+ },
6761
+ children: cfg.message
6762
+ })
6763
+ ]
6764
+ })
6765
+ ]
6766
+ });
6767
+ }
6768
+ function OddsBettingOverlay(param) {
6769
+ var overlay = param.overlay, size = param.size;
6770
+ var cfg = parseConfig(overlay.content);
6771
+ if (!cfg) return null;
6772
+ var f = Math.max(6, size.w * 0.052);
6773
+ return /* @__PURE__ */ jsxs("div", {
6774
+ style: {
6775
+ width: "100%",
6776
+ height: "100%",
6777
+ borderRadius: Math.max(2, size.w * 0.035),
6778
+ display: "flex",
6779
+ flexDirection: "column",
6780
+ padding: f * 0.8,
6781
+ background: cfg.backgroundColor,
6782
+ color: cfg.textColor,
6783
+ fontFamily: "Roboto, 'Segoe UI', Arial, sans-serif",
6784
+ boxSizing: "border-box",
6785
+ pointerEvents: "none",
6786
+ userSelect: "none",
6787
+ fontSize: "".concat(f, "px")
6788
+ },
6789
+ children: [
6790
+ /* @__PURE__ */ jsx("div", {
6791
+ style: {
6792
+ fontSize: "0.9em",
6793
+ fontWeight: 700,
6794
+ textTransform: "uppercase",
6795
+ letterSpacing: "0.05em",
6796
+ color: cfg.accentColor,
6797
+ marginBottom: f * 0.4
6798
+ },
6799
+ children: cfg.eventTitle
6800
+ }),
6801
+ /* @__PURE__ */ jsx("div", {
6802
+ style: {
6803
+ flex: 1,
6804
+ display: "flex",
6805
+ flexDirection: "column",
6806
+ gap: f * 0.2,
6807
+ justifyContent: "center"
6808
+ },
6809
+ children: (cfg.options || []).slice(0, 5).map(function(opt, i) {
6810
+ return /* @__PURE__ */ jsxs("div", {
6811
+ style: {
6812
+ display: "flex",
6813
+ justifyContent: "space-between",
6814
+ alignItems: "center",
6815
+ padding: "".concat(f * 0.2, "px ").concat(f * 0.6, "px"),
6816
+ borderRadius: Math.max(2, f * 0.3),
6817
+ background: "".concat(cfg.accentColor, "15"),
6818
+ fontSize: "1em"
6819
+ },
6820
+ children: [
6821
+ /* @__PURE__ */ jsx("span", {
6822
+ style: {
6823
+ overflow: "hidden",
6824
+ textOverflow: "ellipsis",
6825
+ whiteSpace: "nowrap",
6826
+ flex: 1
6827
+ },
6828
+ children: opt.label
6829
+ }),
6830
+ /* @__PURE__ */ jsx("span", {
6831
+ style: {
6832
+ fontWeight: 700,
6833
+ marginLeft: f * 0.8,
6834
+ flexShrink: 0,
6835
+ color: cfg.accentColor
6836
+ },
6837
+ children: opt.odds
6838
+ })
6839
+ ]
6840
+ }, i);
6841
+ })
6842
+ }),
6843
+ cfg.sponsorText && /* @__PURE__ */ jsx("div", {
6844
+ style: {
6845
+ fontSize: "0.7em",
6846
+ opacity: 0.4,
6847
+ textAlign: "center",
6848
+ marginTop: f * 0.4
6849
+ },
6850
+ children: cfg.sponsorText
6851
+ })
6852
+ ]
6853
+ });
6854
+ }
6855
+ function BreakingNewsOverlay(param) {
6856
+ var overlay = param.overlay, size = param.size;
6857
+ var cfg = parseConfig(overlay.content);
6858
+ if (!cfg) return null;
6859
+ var urgencyColors = {
6860
+ breaking: "#dc2626",
6861
+ urgent: "#ea580c",
6862
+ normal: "#2563eb"
6863
+ };
6864
+ var labelBg = urgencyColors[cfg.urgency] || urgencyColors.normal;
6865
+ var label = cfg.urgency === "breaking" ? "BREAKING" : cfg.urgency === "urgent" ? "URGENT" : "NEWS";
6866
+ var f = Math.max(6, size.w * 0.05);
6867
+ return /* @__PURE__ */ jsxs("div", {
6868
+ style: {
6869
+ width: "100%",
6870
+ height: "100%",
6871
+ borderRadius: Math.max(2, size.w * 0.02),
6872
+ display: "flex",
6873
+ alignItems: "center",
6874
+ background: cfg.backgroundColor,
6875
+ color: cfg.textColor,
6876
+ fontFamily: "Roboto, 'Segoe UI', Arial, sans-serif",
6877
+ overflow: "hidden",
6878
+ pointerEvents: "none",
6879
+ userSelect: "none",
6880
+ fontSize: "".concat(f, "px")
6881
+ },
6882
+ children: [
6883
+ /* @__PURE__ */ jsx("div", {
6884
+ style: {
6885
+ padding: "0 ".concat(f * 0.8, "px"),
6886
+ height: "100%",
6887
+ display: "flex",
6888
+ alignItems: "center",
6889
+ background: labelBg,
6890
+ color: "#fff",
6891
+ fontSize: "1em",
6892
+ fontWeight: 900,
6893
+ textTransform: "uppercase",
6894
+ letterSpacing: "0.05em",
6895
+ flexShrink: 0
6896
+ },
6897
+ children: label
6898
+ }),
6899
+ /* @__PURE__ */ jsxs("div", {
6900
+ style: {
6901
+ flex: 1,
6902
+ padding: "0 ".concat(f * 1, "px"),
6903
+ minWidth: 0
6904
+ },
6905
+ children: [
6906
+ /* @__PURE__ */ jsx("div", {
6907
+ style: {
6908
+ fontSize: "1.3em",
6909
+ fontWeight: 700,
6910
+ overflow: "hidden",
6911
+ textOverflow: "ellipsis",
6912
+ whiteSpace: "nowrap"
6913
+ },
6914
+ children: cfg.headline
6915
+ }),
6916
+ cfg.body && /* @__PURE__ */ jsx("div", {
6917
+ style: {
6918
+ fontSize: "0.9em",
6919
+ opacity: 0.7,
6920
+ overflow: "hidden",
6921
+ textOverflow: "ellipsis",
6922
+ whiteSpace: "nowrap"
6923
+ },
6924
+ children: cfg.body
6925
+ })
6926
+ ]
6927
+ })
6928
+ ]
6929
+ });
6930
+ }
6931
+ function CountdownOverlay(param) {
6932
+ var overlay = param.overlay, size = param.size;
6933
+ var cfg = parseConfig(overlay.content);
6934
+ var _useState = _sliced_to_array(useState({
6935
+ d: 0,
6936
+ h: 0,
6937
+ m: 0,
6938
+ s: 0
6939
+ }), 2), remaining = _useState[0], setRemaining = _useState[1];
6940
+ useEffect(function() {
6941
+ if (!cfg) return;
6942
+ var update = function update() {
6943
+ var target = new Date(cfg.targetTime).getTime();
6944
+ var now = Date.now();
6945
+ var diff = Math.max(0, target - now);
6946
+ setRemaining({
6947
+ d: Math.floor(diff / 864e5),
6948
+ h: Math.floor(diff % 864e5 / 36e5),
6949
+ m: Math.floor(diff % 36e5 / 6e4),
6950
+ s: Math.floor(diff % 6e4 / 1e3)
6951
+ });
6952
+ };
6953
+ update();
6954
+ var id = setInterval(update, 1e3);
6955
+ return function() {
6956
+ return clearInterval(id);
6957
+ };
6958
+ }, [
6959
+ cfg === null || cfg === void 0 ? void 0 : cfg.targetTime
6960
+ ]);
6961
+ if (!cfg) return null;
6962
+ var f = Math.max(6, size.w * 0.055);
6963
+ var pad = function pad(n) {
6964
+ return String(n).padStart(2, "0");
6965
+ };
6966
+ var units = [
6967
+ {
6968
+ show: cfg.showDays,
6969
+ value: pad(remaining.d),
6970
+ label: "DAYS"
6971
+ },
6972
+ {
6973
+ show: cfg.showHours,
6974
+ value: pad(remaining.h),
6975
+ label: "HRS"
6976
+ },
6977
+ {
6978
+ show: cfg.showMinutes,
6979
+ value: pad(remaining.m),
6980
+ label: "MIN"
6981
+ },
6982
+ {
6983
+ show: cfg.showSeconds,
6984
+ value: pad(remaining.s),
6985
+ label: "SEC"
6986
+ }
6987
+ ];
6988
+ return /* @__PURE__ */ jsxs("div", {
6989
+ style: {
6990
+ width: "100%",
6991
+ height: "100%",
6992
+ borderRadius: Math.max(2, size.w * 0.035),
6993
+ display: "flex",
6994
+ flexDirection: "column",
6995
+ alignItems: "center",
6996
+ justifyContent: "center",
6997
+ padding: f * 0.8,
6998
+ background: cfg.backgroundColor,
6999
+ color: cfg.textColor,
7000
+ fontFamily: "Roboto, 'Segoe UI', Arial, sans-serif",
7001
+ boxSizing: "border-box",
7002
+ pointerEvents: "none",
7003
+ userSelect: "none",
7004
+ fontSize: "".concat(f, "px")
7005
+ },
7006
+ children: [
7007
+ /* @__PURE__ */ jsx("div", {
7008
+ style: {
7009
+ fontSize: "0.8em",
7010
+ fontWeight: 600,
7011
+ textTransform: "uppercase",
7012
+ letterSpacing: "0.05em",
7013
+ color: cfg.accentColor,
7014
+ marginBottom: f * 0.4
7015
+ },
7016
+ children: cfg.eventName
7017
+ }),
7018
+ /* @__PURE__ */ jsx("div", {
7019
+ style: {
7020
+ display: "flex",
7021
+ gap: f * 0.6,
7022
+ alignItems: "center"
7023
+ },
7024
+ children: units.filter(function(u) {
7025
+ return u.show;
7026
+ }).map(function(u, i, arr) {
7027
+ return /* @__PURE__ */ jsxs(React.Fragment, {
7028
+ children: [
7029
+ /* @__PURE__ */ jsxs("div", {
7030
+ style: {
7031
+ textAlign: "center"
7032
+ },
7033
+ children: [
7034
+ /* @__PURE__ */ jsx("div", {
7035
+ style: {
7036
+ fontSize: "2em",
7037
+ fontWeight: 900,
7038
+ lineHeight: 1,
7039
+ borderRadius: Math.max(2, f * 0.4),
7040
+ padding: "".concat(f * 0.2, "px ").concat(f * 0.4, "px"),
7041
+ background: "".concat(cfg.accentColor, "20")
7042
+ },
7043
+ children: u.value
7044
+ }),
7045
+ /* @__PURE__ */ jsx("div", {
7046
+ style: {
7047
+ fontSize: "0.5em",
7048
+ opacity: 0.5,
7049
+ marginTop: f * 0.2
7050
+ },
7051
+ children: u.label
7052
+ })
7053
+ ]
7054
+ }),
7055
+ i < arr.length - 1 && /* @__PURE__ */ jsx("div", {
7056
+ style: {
7057
+ fontSize: "1.8em",
7058
+ fontWeight: 700,
7059
+ opacity: 0.3
7060
+ },
7061
+ children: ":"
7062
+ })
7063
+ ]
7064
+ }, u.label);
7065
+ })
7066
+ }),
7067
+ cfg.message && /* @__PURE__ */ jsx("div", {
7068
+ style: {
7069
+ fontSize: "0.8em",
7070
+ opacity: 0.6,
7071
+ marginTop: f * 0.4,
7072
+ textAlign: "center"
7073
+ },
7074
+ children: cfg.message
7075
+ })
7076
+ ]
7077
+ });
7078
+ }
7079
+ function ShapeOverlay(param) {
7080
+ var overlay = param.overlay, size = param.size;
7081
+ var f = Math.max(6, size.w * 0.05);
7082
+ return /* @__PURE__ */ jsx("div", {
7083
+ style: {
7084
+ width: "100%",
7085
+ height: "100%",
7086
+ borderRadius: Math.max(2, size.w * 0.03),
7087
+ background: "rgba(99, 102, 241, 0.2)",
7088
+ border: "2px solid rgba(99, 102, 241, 0.4)",
7089
+ display: "flex",
7090
+ alignItems: "center",
7091
+ justifyContent: "center",
7092
+ pointerEvents: "none",
7093
+ userSelect: "none"
7094
+ },
7095
+ children: /* @__PURE__ */ jsx("div", {
7096
+ style: {
7097
+ fontSize: "".concat(f, "px"),
7098
+ fontWeight: 500,
7099
+ color: "rgba(163, 163, 163, 0.8)",
7100
+ textTransform: "uppercase"
7101
+ },
7102
+ children: overlay.name
7103
+ })
7104
+ });
7105
+ }
6361
7106
  function hexToRgb(hex) {
6362
7107
  if (!hex || !hex.startsWith("#")) return "0,0,0";
6363
7108
  var clean = hex.slice(1);
@@ -6422,6 +7167,10 @@ var OverlayRenderer = function OverlayRenderer(param) {
6422
7167
  var width = overlay.width * scaleX;
6423
7168
  var height = overlay.height * scaleY;
6424
7169
  var opacity = Math.max(0, Math.min(100, overlay.opacity)) / 100;
7170
+ var sz = {
7171
+ w: width,
7172
+ h: height
7173
+ };
6425
7174
  return /* @__PURE__ */ jsxs("div", {
6426
7175
  style: {
6427
7176
  position: "absolute",
@@ -6442,6 +7191,42 @@ var OverlayRenderer = function OverlayRenderer(param) {
6442
7191
  }),
6443
7192
  overlay.type === "scroller" && /* @__PURE__ */ jsx(ScrollerOverlay, {
6444
7193
  overlay: overlay
7194
+ }),
7195
+ overlay.type === "shape" && /* @__PURE__ */ jsx(ShapeOverlay, {
7196
+ overlay: overlay,
7197
+ size: sz
7198
+ }),
7199
+ overlay.type === "score_bug" && /* @__PURE__ */ jsx(ScoreBugOverlay, {
7200
+ overlay: overlay,
7201
+ size: sz
7202
+ }),
7203
+ overlay.type === "lower_third" && /* @__PURE__ */ jsx(LowerThirdOverlay, {
7204
+ overlay: overlay,
7205
+ size: sz
7206
+ }),
7207
+ overlay.type === "qr_code" && /* @__PURE__ */ jsx(QrCodeOverlay, {
7208
+ overlay: overlay,
7209
+ size: sz
7210
+ }),
7211
+ overlay.type === "coming_up_next" && /* @__PURE__ */ jsx(ComingUpNextOverlay, {
7212
+ overlay: overlay,
7213
+ size: sz
7214
+ }),
7215
+ overlay.type === "contextual_trigger" && /* @__PURE__ */ jsx(ContextualTriggerOverlay, {
7216
+ overlay: overlay,
7217
+ size: sz
7218
+ }),
7219
+ overlay.type === "odds_betting" && /* @__PURE__ */ jsx(OddsBettingOverlay, {
7220
+ overlay: overlay,
7221
+ size: sz
7222
+ }),
7223
+ overlay.type === "breaking_news" && /* @__PURE__ */ jsx(BreakingNewsOverlay, {
7224
+ overlay: overlay,
7225
+ size: sz
7226
+ }),
7227
+ overlay.type === "countdown" && /* @__PURE__ */ jsx(CountdownOverlay, {
7228
+ overlay: overlay,
7229
+ size: sz
6445
7230
  })
6446
7231
  ]
6447
7232
  }, overlay.id);
@@ -6692,17 +7477,28 @@ var StormcloudVideoPlayerComponent = React2.memo(function(props) {
6692
7477
  if (!swirlProjectId) return;
6693
7478
  var player = playerRef.current;
6694
7479
  if (!player) return;
7480
+ var attempts = 0;
7481
+ var maxAttempts = 30;
6695
7482
  var tryResolve = function tryResolve() {
6696
7483
  var res = player.getMinHlsResolution();
6697
7484
  if (res) {
6698
7485
  setOverlayCoordSpace(res);
6699
7486
  return true;
6700
7487
  }
7488
+ var video = player.videoElement;
7489
+ if (video && video.videoWidth > 0 && video.videoHeight > 0) {
7490
+ setOverlayCoordSpace({
7491
+ width: video.videoWidth,
7492
+ height: video.videoHeight
7493
+ });
7494
+ return true;
7495
+ }
6701
7496
  return false;
6702
7497
  };
6703
7498
  if (tryResolve()) return;
6704
7499
  var interval = setInterval(function() {
6705
- if (tryResolve()) clearInterval(interval);
7500
+ attempts++;
7501
+ if (tryResolve() || attempts >= maxAttempts) clearInterval(interval);
6706
7502
  }, 300);
6707
7503
  return function() {
6708
7504
  return clearInterval(interval);