stormcloud-video-player 0.7.0 → 0.7.2

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
@@ -6133,9 +6133,9 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
6133
6133
  return StormcloudVideoPlayer;
6134
6134
  }();
6135
6135
  // src/ui/StormcloudVideoPlayer.tsx
6136
- import { FaPlay, FaPause, FaVolumeUp, FaVolumeMute, FaVolumeDown, FaExpand, FaCompress, FaSpinner } from "react-icons/fa";
6136
+ import { FaPlay, FaPause, FaVolumeUp, FaVolumeMute, FaVolumeDown, FaExpand, FaCompress } 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);
@@ -6458,6 +7243,7 @@ var CRITICAL_PROPS = [
6458
7243
  "driftToleranceMs"
6459
7244
  ];
6460
7245
  var CONTROLS_HIDE_DELAY = 3e3;
7246
+ var DEFAULT_PLAYER_ASPECT_RATIO = 16 / 9;
6461
7247
  var StormcloudVideoPlayerComponent = React2.memo(function(props) {
6462
7248
  var src = props.src, autoplay = props.autoplay, muted = props.muted, lowLatencyMode = props.lowLatencyMode, allowNativeHls = props.allowNativeHls, driftToleranceMs = props.driftToleranceMs, immediateManifestAds = props.immediateManifestAds, debugAdTiming = props.debugAdTiming, showCustomControls = props.showCustomControls, hideLoadingIndicator = props.hideLoadingIndicator, onVolumeToggle = props.onVolumeToggle, onFullscreenToggle = props.onFullscreenToggle, onControlClick = props.onControlClick, onReady = props.onReady, wrapperClassName = props.wrapperClassName, wrapperStyle = props.wrapperStyle, className = props.className, style = props.style, controls = props.controls, playsInline = props.playsInline, preload = props.preload, poster = props.poster, children = props.children, licenseKey = props.licenseKey, minSegmentsBeforePlay = props.minSegmentsBeforePlay, disableAds = props.disableAds, disableFiller = props.disableFiller, swirlProjectId = props.swirlProjectId, restVideoAttrs = _object_without_properties(props, [
6463
7249
  "src",
@@ -6518,6 +7304,7 @@ var StormcloudVideoPlayerComponent = React2.memo(function(props) {
6518
7304
  var _React2_useState17 = _sliced_to_array(React2.useState(null), 2), overlayCoordSpace = _React2_useState17[0], setOverlayCoordSpace = _React2_useState17[1];
6519
7305
  var _React2_useState18 = _sliced_to_array(React2.useState(typeof window !== "undefined" ? window.innerWidth : 1920), 2), viewportWidth = _React2_useState18[0], setViewportWidth = _React2_useState18[1];
6520
7306
  var _React2_useState19 = _sliced_to_array(React2.useState(typeof window !== "undefined" ? window.innerHeight > window.innerWidth : false), 2), isPortrait = _React2_useState19[0], setIsPortrait = _React2_useState19[1];
7307
+ var _React2_useState20 = _sliced_to_array(React2.useState(DEFAULT_PLAYER_ASPECT_RATIO), 2), playerAspectRatio = _React2_useState20[0], setPlayerAspectRatio = _React2_useState20[1];
6521
7308
  var getResponsiveScale = function getResponsiveScale() {
6522
7309
  if (viewportWidth < 480) return 0.7;
6523
7310
  if (viewportWidth < 768) return 0.8;
@@ -6692,17 +7479,28 @@ var StormcloudVideoPlayerComponent = React2.memo(function(props) {
6692
7479
  if (!swirlProjectId) return;
6693
7480
  var player = playerRef.current;
6694
7481
  if (!player) return;
7482
+ var attempts = 0;
7483
+ var maxAttempts = 30;
6695
7484
  var tryResolve = function tryResolve() {
6696
7485
  var res = player.getMinHlsResolution();
6697
7486
  if (res) {
6698
7487
  setOverlayCoordSpace(res);
6699
7488
  return true;
6700
7489
  }
7490
+ var video = player.videoElement;
7491
+ if (video && video.videoWidth > 0 && video.videoHeight > 0) {
7492
+ setOverlayCoordSpace({
7493
+ width: video.videoWidth,
7494
+ height: video.videoHeight
7495
+ });
7496
+ return true;
7497
+ }
6701
7498
  return false;
6702
7499
  };
6703
7500
  if (tryResolve()) return;
6704
7501
  var interval = setInterval(function() {
6705
- if (tryResolve()) clearInterval(interval);
7502
+ attempts++;
7503
+ if (tryResolve() || attempts >= maxAttempts) clearInterval(interval);
6706
7504
  }, 300);
6707
7505
  return function() {
6708
7506
  return clearInterval(interval);
@@ -6802,6 +7600,13 @@ var StormcloudVideoPlayerComponent = React2.memo(function(props) {
6802
7600
  }, []);
6803
7601
  useEffect2(function() {
6804
7602
  if (!videoRef.current) return;
7603
+ var handleLoadedMetadata = function handleLoadedMetadata() {
7604
+ var video2 = videoRef.current;
7605
+ if (!video2) return;
7606
+ if (video2.videoWidth > 0 && video2.videoHeight > 0) {
7607
+ setPlayerAspectRatio(video2.videoWidth / video2.videoHeight);
7608
+ }
7609
+ };
6805
7610
  var handleCanPlay = function handleCanPlay() {
6806
7611
  setIsLoading(false);
6807
7612
  if (bufferingTimeoutRef.current) {
@@ -6848,6 +7653,8 @@ var StormcloudVideoPlayerComponent = React2.memo(function(props) {
6848
7653
  setShowCenterPlay(true);
6849
7654
  };
6850
7655
  var video = videoRef.current;
7656
+ handleLoadedMetadata();
7657
+ video.addEventListener("loadedmetadata", handleLoadedMetadata);
6851
7658
  video.addEventListener("canplay", handleCanPlay);
6852
7659
  video.addEventListener("canplaythrough", handleCanPlayThrough);
6853
7660
  video.addEventListener("waiting", handleWaiting);
@@ -6862,6 +7669,7 @@ var StormcloudVideoPlayerComponent = React2.memo(function(props) {
6862
7669
  clearTimeout(bufferingTimeoutRef.current);
6863
7670
  bufferingTimeoutRef.current = null;
6864
7671
  }
7672
+ video.removeEventListener("loadedmetadata", handleLoadedMetadata);
6865
7673
  video.removeEventListener("canplay", handleCanPlay);
6866
7674
  video.removeEventListener("canplaythrough", handleCanPlayThrough);
6867
7675
  video.removeEventListener("waiting", handleWaiting);
@@ -6872,6 +7680,11 @@ var StormcloudVideoPlayerComponent = React2.memo(function(props) {
6872
7680
  }, [
6873
7681
  debugAdTiming
6874
7682
  ]);
7683
+ useEffect2(function() {
7684
+ setPlayerAspectRatio(DEFAULT_PLAYER_ASPECT_RATIO);
7685
+ }, [
7686
+ src
7687
+ ]);
6875
7688
  useEffect2(function() {
6876
7689
  return function() {
6877
7690
  if (controlsTimerRef.current) {
@@ -6897,7 +7710,7 @@ var StormcloudVideoPlayerComponent = React2.memo(function(props) {
6897
7710
  return /* @__PURE__ */ jsxs2(Fragment2, {
6898
7711
  children: [
6899
7712
  /* @__PURE__ */ jsx2("style", {
6900
- children: "\n @keyframes sc-spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n @keyframes sc-pulse {\n 0%, 100% { opacity: 1; }\n 50% { opacity: 0.6; }\n }\n @keyframes sc-fade-in {\n from { opacity: 0; transform: translateY(8px); }\n to { opacity: 1; transform: translateY(0); }\n }\n .sc-wrapper:fullscreen,\n .sc-wrapper:has(*:fullscreen) {\n border-radius: 0 !important;\n box-shadow: none !important;\n width: 100vw !important;\n height: 100vh !important;\n max-width: 100vw !important;\n max-height: 100vh !important;\n position: fixed !important;\n top: 0 !important;\n left: 0 !important;\n z-index: 999999 !important;\n background: #000 !important;\n display: flex !important;\n align-items: center !important;\n justify-content: center !important;\n }\n .sc-ctrl-btn {\n background: none;\n border: none;\n color: #fff;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 50%;\n padding: 8px;\n transition: background 0.15s ease, opacity 0.15s ease;\n opacity: 0.9;\n }\n .sc-ctrl-btn:hover {\n opacity: 1;\n background: rgba(255, 255, 255, 0.1);\n }\n .sc-ctrl-btn:active {\n opacity: 0.7;\n }\n .sc-controls-bar {\n transition: opacity 0.35s ease, transform 0.35s ease;\n }\n .sc-progress-track:hover .sc-progress-thumb {\n transform: translate(-50%, -50%) scale(1) !important;\n }\n .sc-loading-hidden .sc-loading-indicator {\n display: none !important;\n }\n "
7713
+ children: "\n @keyframes sc-spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n @keyframes sc-loading-glow {\n 0%, 100% { opacity: 0.85; transform: scale(1); }\n 50% { opacity: 1; transform: scale(1.05); }\n }\n @keyframes sc-pulse {\n 0%, 100% { opacity: 1; }\n 50% { opacity: 0.6; }\n }\n @keyframes sc-fade-in {\n from { opacity: 0; transform: translateY(8px); }\n to { opacity: 1; transform: translateY(0); }\n }\n .sc-wrapper:fullscreen,\n .sc-wrapper:has(*:fullscreen) {\n border-radius: 0 !important;\n box-shadow: none !important;\n width: 100vw !important;\n height: 100vh !important;\n max-width: 100vw !important;\n max-height: 100vh !important;\n position: fixed !important;\n top: 0 !important;\n left: 0 !important;\n z-index: 999999 !important;\n background: #000 !important;\n display: flex !important;\n align-items: center !important;\n justify-content: center !important;\n }\n .sc-ctrl-btn {\n background: none;\n border: none;\n color: #fff;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 50%;\n padding: 8px;\n transition: background 0.15s ease, opacity 0.15s ease;\n opacity: 0.9;\n }\n .sc-ctrl-btn:hover {\n opacity: 1;\n background: rgba(255, 255, 255, 0.1);\n }\n .sc-ctrl-btn:active {\n opacity: 0.7;\n }\n .sc-controls-bar {\n transition: opacity 0.35s ease, transform 0.35s ease;\n }\n .sc-progress-track:hover .sc-progress-thumb {\n transform: translate(-50%, -50%) scale(1) !important;\n }\n .sc-loading-hidden .sc-loading-indicator {\n display: none !important;\n }\n "
6901
7714
  }),
6902
7715
  /* @__PURE__ */ jsxs2("div", {
6903
7716
  ref: wrapperRef,
@@ -6915,6 +7728,7 @@ var StormcloudVideoPlayerComponent = React2.memo(function(props) {
6915
7728
  width: isFullscreen ? "100vw" : "100%",
6916
7729
  height: isFullscreen ? "100vh" : "auto",
6917
7730
  minHeight: isFullscreen ? "100vh" : "auto",
7731
+ aspectRatio: isFullscreen ? void 0 : playerAspectRatio,
6918
7732
  maxWidth: isFullscreen ? "100vw" : "100%",
6919
7733
  maxHeight: isFullscreen ? "100vh" : "none",
6920
7734
  zIndex: isFullscreen ? 999999 : void 0,
@@ -6931,7 +7745,7 @@ var StormcloudVideoPlayerComponent = React2.memo(function(props) {
6931
7745
  zIndex: 1,
6932
7746
  display: "block",
6933
7747
  width: "100%",
6934
- height: isFullscreen ? "100%" : "auto",
7748
+ height: "100%",
6935
7749
  maxWidth: "100%",
6936
7750
  maxHeight: isFullscreen ? "100%" : "none",
6937
7751
  objectFit: isFullscreen ? "cover" : "contain",
@@ -6951,18 +7765,44 @@ var StormcloudVideoPlayerComponent = React2.memo(function(props) {
6951
7765
  videoRef: videoRef,
6952
7766
  coordinateSpace: overlayCoordSpace
6953
7767
  }),
6954
- (isLoading || isBuffering) && !hideLoadingIndicator && /* @__PURE__ */ jsx2(FaSpinner, {
7768
+ (isLoading || isBuffering) && !hideLoadingIndicator && /* @__PURE__ */ jsxs2("div", {
6955
7769
  className: "sc-loading-indicator",
6956
- size: 40,
6957
- color: "rgba(255, 255, 255, 0.85)",
6958
7770
  style: {
6959
7771
  position: "absolute",
6960
- top: "calc(50% - 20px)",
6961
- left: "calc(50% - 20px)",
7772
+ top: "50%",
7773
+ left: "50%",
7774
+ transform: "translate(-50%, -50%)",
6962
7775
  zIndex: 20,
6963
- animation: "sc-spin 0.9s linear infinite",
6964
- filter: "drop-shadow(0 2px 8px rgba(0, 0, 0, 0.6))"
6965
- }
7776
+ width: "".concat(Math.max(34, 38 * responsiveScale), "px"),
7777
+ height: "".concat(Math.max(34, 38 * responsiveScale), "px"),
7778
+ display: "flex",
7779
+ alignItems: "center",
7780
+ justifyContent: "center",
7781
+ animation: "sc-loading-glow 1.4s ease-in-out infinite",
7782
+ filter: "drop-shadow(0 6px 14px rgba(0, 0, 0, 0.55))"
7783
+ },
7784
+ children: [
7785
+ /* @__PURE__ */ jsx2("div", {
7786
+ style: {
7787
+ position: "absolute",
7788
+ inset: 0,
7789
+ borderRadius: "50%",
7790
+ border: "3px solid rgba(255, 255, 255, 0.25)",
7791
+ borderTopColor: "#ff0000",
7792
+ borderRightColor: "rgba(255, 255, 255, 0.85)",
7793
+ animation: "sc-spin 0.8s linear infinite"
7794
+ }
7795
+ }),
7796
+ /* @__PURE__ */ jsx2("div", {
7797
+ style: {
7798
+ width: "7px",
7799
+ height: "7px",
7800
+ borderRadius: "50%",
7801
+ background: "#ff0000",
7802
+ boxShadow: "0 0 10px rgba(255, 0, 0, 0.65)"
7803
+ }
7804
+ })
7805
+ ]
6966
7806
  }),
6967
7807
  showLicenseWarning && /* @__PURE__ */ jsxs2("div", {
6968
7808
  style: {
@@ -7198,7 +8038,8 @@ var StormcloudVideoPlayerComponent = React2.memo(function(props) {
7198
8038
  /* @__PURE__ */ jsxs2("div", {
7199
8039
  style: {
7200
8040
  display: "flex",
7201
- alignItems: "center"
8041
+ alignItems: "center",
8042
+ paddingRight: "".concat(6 * responsiveScale, "px")
7202
8043
  },
7203
8044
  onMouseEnter: function onMouseEnter() {
7204
8045
  return setShowVolumeSlider(true);
@@ -7229,13 +8070,13 @@ var StormcloudVideoPlayerComponent = React2.memo(function(props) {
7229
8070
  }),
7230
8071
  /* @__PURE__ */ jsx2("div", {
7231
8072
  style: {
7232
- width: showVolumeSlider ? "".concat(62 * responsiveScale, "px") : "0px",
8073
+ width: showVolumeSlider ? "".concat(68 * responsiveScale, "px") : "0px",
7233
8074
  overflow: "hidden",
7234
8075
  transition: "width 0.2s cubic-bezier(0.4, 0, 0.2, 1)",
7235
8076
  display: "flex",
7236
8077
  alignItems: "center",
7237
- paddingLeft: showVolumeSlider ? "2px" : "0",
7238
- paddingRight: showVolumeSlider ? "4px" : "0"
8078
+ paddingLeft: showVolumeSlider ? "".concat(3 * responsiveScale, "px") : "0",
8079
+ paddingRight: showVolumeSlider ? "".concat(8 * responsiveScale, "px") : "0"
7239
8080
  },
7240
8081
  children: /* @__PURE__ */ jsxs2("div", {
7241
8082
  style: {
@@ -7482,7 +8323,8 @@ var StormcloudVideoPlayerComponent = React2.memo(function(props) {
7482
8323
  alignItems: "center",
7483
8324
  background: "rgba(0, 0, 0, 0.6)",
7484
8325
  borderRadius: "".concat(18 * responsiveScale, "px"),
7485
- padding: "2px"
8326
+ padding: "2px",
8327
+ paddingRight: "".concat(8 * responsiveScale, "px")
7486
8328
  },
7487
8329
  onMouseEnter: function onMouseEnter() {
7488
8330
  return setShowVolumeSlider(true);
@@ -7511,13 +8353,13 @@ var StormcloudVideoPlayerComponent = React2.memo(function(props) {
7511
8353
  }),
7512
8354
  /* @__PURE__ */ jsx2("div", {
7513
8355
  style: {
7514
- width: showVolumeSlider ? "".concat(62 * responsiveScale, "px") : "0px",
8356
+ width: showVolumeSlider ? "".concat(68 * responsiveScale, "px") : "0px",
7515
8357
  overflow: "hidden",
7516
8358
  transition: "width 0.2s cubic-bezier(0.4, 0, 0.2, 1)",
7517
8359
  display: "flex",
7518
8360
  alignItems: "center",
7519
- paddingLeft: showVolumeSlider ? "2px" : "0",
7520
- paddingRight: showVolumeSlider ? "6px" : "0"
8361
+ paddingLeft: showVolumeSlider ? "".concat(3 * responsiveScale, "px") : "0",
8362
+ paddingRight: showVolumeSlider ? "".concat(10 * responsiveScale, "px") : "0"
7521
8363
  },
7522
8364
  children: /* @__PURE__ */ jsxs2("div", {
7523
8365
  style: {