stormcloud-video-player 0.7.8 → 0.7.9

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
@@ -6507,15 +6507,38 @@ function ScoreBugOverlay(param) {
6507
6507
  })
6508
6508
  ]
6509
6509
  }),
6510
- cfg.sponsorText && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
6510
+ (cfg.sponsorText || cfg.sponsorImageUrl) && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
6511
6511
  style: {
6512
6512
  fontSize: "0.7em",
6513
6513
  textAlign: "center",
6514
- opacity: 0.5,
6515
- padding: "".concat(f * 0.2, "px 0"),
6516
- borderTop: "1px solid ".concat(cfg.accentColor, "40")
6514
+ opacity: 0.6,
6515
+ padding: "".concat(f * 0.2, "px ").concat(f * 0.4, "px"),
6516
+ borderTop: "1px solid ".concat(cfg.accentColor, "40"),
6517
+ display: "flex",
6518
+ alignItems: "center",
6519
+ justifyContent: "center",
6520
+ gap: f * 0.4,
6521
+ overflow: "hidden"
6517
6522
  },
6518
- children: cfg.sponsorText
6523
+ children: [
6524
+ cfg.sponsorImageUrl && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
6525
+ src: cfg.sponsorImageUrl,
6526
+ alt: "sponsor",
6527
+ style: {
6528
+ height: "".concat(f * 1.4, "px"),
6529
+ objectFit: "contain",
6530
+ flexShrink: 0
6531
+ }
6532
+ }),
6533
+ cfg.sponsorText && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
6534
+ style: {
6535
+ overflow: "hidden",
6536
+ textOverflow: "ellipsis",
6537
+ whiteSpace: "nowrap"
6538
+ },
6539
+ children: cfg.sponsorText
6540
+ })
6541
+ ]
6519
6542
  })
6520
6543
  ]
6521
6544
  });
@@ -6577,13 +6600,35 @@ function LowerThirdOverlay(param) {
6577
6600
  })
6578
6601
  ]
6579
6602
  }),
6580
- cfg.sponsorText && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
6603
+ (cfg.sponsorText || cfg.sponsorImageUrl) && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
6581
6604
  style: {
6582
6605
  fontSize: "0.7em",
6583
- opacity: 0.4,
6584
- padding: "0 ".concat(f * 1.2, "px ").concat(f * 0.4, "px")
6606
+ opacity: 0.5,
6607
+ padding: "0 ".concat(f * 1.2, "px ").concat(f * 0.4, "px"),
6608
+ display: "flex",
6609
+ alignItems: "center",
6610
+ gap: f * 0.4,
6611
+ overflow: "hidden"
6585
6612
  },
6586
- children: cfg.sponsorText
6613
+ children: [
6614
+ cfg.sponsorImageUrl && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
6615
+ src: cfg.sponsorImageUrl,
6616
+ alt: "sponsor",
6617
+ style: {
6618
+ height: "".concat(f * 1.4, "px"),
6619
+ objectFit: "contain",
6620
+ flexShrink: 0
6621
+ }
6622
+ }),
6623
+ cfg.sponsorText && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
6624
+ style: {
6625
+ overflow: "hidden",
6626
+ textOverflow: "ellipsis",
6627
+ whiteSpace: "nowrap"
6628
+ },
6629
+ children: cfg.sponsorText
6630
+ })
6631
+ ]
6587
6632
  })
6588
6633
  ]
6589
6634
  });
@@ -6740,6 +6785,23 @@ function ComingUpNextOverlay(param) {
6740
6785
  children: cfg.scheduledTime
6741
6786
  })
6742
6787
  ]
6788
+ }),
6789
+ cfg.thumbnailUrl && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
6790
+ style: {
6791
+ flexShrink: 0,
6792
+ width: Math.max(40, size.h * 0.75),
6793
+ overflow: "hidden"
6794
+ },
6795
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
6796
+ src: cfg.thumbnailUrl,
6797
+ alt: "thumbnail",
6798
+ style: {
6799
+ width: "100%",
6800
+ height: "100%",
6801
+ objectFit: "cover",
6802
+ display: "block"
6803
+ }
6804
+ })
6743
6805
  })
6744
6806
  ]
6745
6807
  });
@@ -6975,35 +7037,41 @@ function BreakingNewsOverlay(param) {
6975
7037
  ]
6976
7038
  });
6977
7039
  }
7040
+ function calcCountdownRemaining(targetTime) {
7041
+ var diff = Math.max(0, new Date(targetTime).getTime() - Date.now());
7042
+ return {
7043
+ d: Math.floor(diff / 864e5),
7044
+ h: Math.floor(diff % 864e5 / 36e5),
7045
+ m: Math.floor(diff % 36e5 / 6e4),
7046
+ s: Math.floor(diff % 6e4 / 1e3),
7047
+ expired: diff === 0
7048
+ };
7049
+ }
6978
7050
  function CountdownOverlay(param) {
6979
7051
  var overlay = param.overlay, size = param.size;
7052
+ var _ref;
6980
7053
  var cfg = parseConfig(overlay.content);
6981
- var _ref = _sliced_to_array((0, import_react.useState)({
6982
- d: 0,
6983
- h: 0,
6984
- m: 0,
6985
- s: 0
6986
- }), 2), remaining = _ref[0], setRemaining = _ref[1];
6987
- (0, import_react.useEffect)(function() {
6988
- if (!cfg) return;
6989
- var update = function update() {
6990
- var target = new Date(cfg.targetTime).getTime();
6991
- var now = Date.now();
6992
- var diff = Math.max(0, target - now);
6993
- setRemaining({
6994
- d: Math.floor(diff / 864e5),
6995
- h: Math.floor(diff % 864e5 / 36e5),
6996
- m: Math.floor(diff % 36e5 / 6e4),
6997
- s: Math.floor(diff % 6e4 / 1e3)
6998
- });
7054
+ var targetTime = (_ref = cfg === null || cfg === void 0 ? void 0 : cfg.targetTime) !== null && _ref !== void 0 ? _ref : "";
7055
+ var _ref1 = _sliced_to_array((0, import_react.useState)(function() {
7056
+ return targetTime ? calcCountdownRemaining(targetTime) : {
7057
+ d: 0,
7058
+ h: 0,
7059
+ m: 0,
7060
+ s: 0,
7061
+ expired: false
6999
7062
  };
7000
- update();
7001
- var id = setInterval(update, 1e3);
7063
+ }), 2), remaining = _ref1[0], setRemaining = _ref1[1];
7064
+ (0, import_react.useEffect)(function() {
7065
+ if (!targetTime) return;
7066
+ setRemaining(calcCountdownRemaining(targetTime));
7067
+ var id = setInterval(function() {
7068
+ return setRemaining(calcCountdownRemaining(targetTime));
7069
+ }, 1e3);
7002
7070
  return function() {
7003
7071
  return clearInterval(id);
7004
7072
  };
7005
7073
  }, [
7006
- cfg === null || cfg === void 0 ? void 0 : cfg.targetTime
7074
+ targetTime
7007
7075
  ]);
7008
7076
  if (!cfg) return null;
7009
7077
  var f = Math.max(6, size.w * 0.055);
@@ -7062,7 +7130,14 @@ function CountdownOverlay(param) {
7062
7130
  },
7063
7131
  children: cfg.eventName
7064
7132
  }),
7065
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
7133
+ remaining.expired ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
7134
+ style: {
7135
+ fontSize: "1em",
7136
+ fontWeight: 700,
7137
+ opacity: 0.6
7138
+ },
7139
+ children: cfg.message || "Event ended"
7140
+ }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
7066
7141
  style: {
7067
7142
  display: "flex",
7068
7143
  gap: f * 0.6,
@@ -7111,7 +7186,7 @@ function CountdownOverlay(param) {
7111
7186
  }, u.label);
7112
7187
  })
7113
7188
  }),
7114
- cfg.message && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
7189
+ !remaining.expired && cfg.message && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
7115
7190
  style: {
7116
7191
  fontSize: "0.8em",
7117
7192
  opacity: 0.6,