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.js CHANGED
@@ -6341,15 +6341,38 @@ function ScoreBugOverlay(param) {
6341
6341
  })
6342
6342
  ]
6343
6343
  }),
6344
- cfg.sponsorText && /* @__PURE__ */ jsx("div", {
6344
+ (cfg.sponsorText || cfg.sponsorImageUrl) && /* @__PURE__ */ jsxs("div", {
6345
6345
  style: {
6346
6346
  fontSize: "0.7em",
6347
6347
  textAlign: "center",
6348
- opacity: 0.5,
6349
- padding: "".concat(f * 0.2, "px 0"),
6350
- borderTop: "1px solid ".concat(cfg.accentColor, "40")
6348
+ opacity: 0.6,
6349
+ padding: "".concat(f * 0.2, "px ").concat(f * 0.4, "px"),
6350
+ borderTop: "1px solid ".concat(cfg.accentColor, "40"),
6351
+ display: "flex",
6352
+ alignItems: "center",
6353
+ justifyContent: "center",
6354
+ gap: f * 0.4,
6355
+ overflow: "hidden"
6351
6356
  },
6352
- children: cfg.sponsorText
6357
+ children: [
6358
+ cfg.sponsorImageUrl && /* @__PURE__ */ jsx("img", {
6359
+ src: cfg.sponsorImageUrl,
6360
+ alt: "sponsor",
6361
+ style: {
6362
+ height: "".concat(f * 1.4, "px"),
6363
+ objectFit: "contain",
6364
+ flexShrink: 0
6365
+ }
6366
+ }),
6367
+ cfg.sponsorText && /* @__PURE__ */ jsx("span", {
6368
+ style: {
6369
+ overflow: "hidden",
6370
+ textOverflow: "ellipsis",
6371
+ whiteSpace: "nowrap"
6372
+ },
6373
+ children: cfg.sponsorText
6374
+ })
6375
+ ]
6353
6376
  })
6354
6377
  ]
6355
6378
  });
@@ -6411,13 +6434,35 @@ function LowerThirdOverlay(param) {
6411
6434
  })
6412
6435
  ]
6413
6436
  }),
6414
- cfg.sponsorText && /* @__PURE__ */ jsx("div", {
6437
+ (cfg.sponsorText || cfg.sponsorImageUrl) && /* @__PURE__ */ jsxs("div", {
6415
6438
  style: {
6416
6439
  fontSize: "0.7em",
6417
- opacity: 0.4,
6418
- padding: "0 ".concat(f * 1.2, "px ").concat(f * 0.4, "px")
6440
+ opacity: 0.5,
6441
+ padding: "0 ".concat(f * 1.2, "px ").concat(f * 0.4, "px"),
6442
+ display: "flex",
6443
+ alignItems: "center",
6444
+ gap: f * 0.4,
6445
+ overflow: "hidden"
6419
6446
  },
6420
- children: cfg.sponsorText
6447
+ children: [
6448
+ cfg.sponsorImageUrl && /* @__PURE__ */ jsx("img", {
6449
+ src: cfg.sponsorImageUrl,
6450
+ alt: "sponsor",
6451
+ style: {
6452
+ height: "".concat(f * 1.4, "px"),
6453
+ objectFit: "contain",
6454
+ flexShrink: 0
6455
+ }
6456
+ }),
6457
+ cfg.sponsorText && /* @__PURE__ */ jsx("span", {
6458
+ style: {
6459
+ overflow: "hidden",
6460
+ textOverflow: "ellipsis",
6461
+ whiteSpace: "nowrap"
6462
+ },
6463
+ children: cfg.sponsorText
6464
+ })
6465
+ ]
6421
6466
  })
6422
6467
  ]
6423
6468
  });
@@ -6574,6 +6619,23 @@ function ComingUpNextOverlay(param) {
6574
6619
  children: cfg.scheduledTime
6575
6620
  })
6576
6621
  ]
6622
+ }),
6623
+ cfg.thumbnailUrl && /* @__PURE__ */ jsx("div", {
6624
+ style: {
6625
+ flexShrink: 0,
6626
+ width: Math.max(40, size.h * 0.75),
6627
+ overflow: "hidden"
6628
+ },
6629
+ children: /* @__PURE__ */ jsx("img", {
6630
+ src: cfg.thumbnailUrl,
6631
+ alt: "thumbnail",
6632
+ style: {
6633
+ width: "100%",
6634
+ height: "100%",
6635
+ objectFit: "cover",
6636
+ display: "block"
6637
+ }
6638
+ })
6577
6639
  })
6578
6640
  ]
6579
6641
  });
@@ -6809,35 +6871,41 @@ function BreakingNewsOverlay(param) {
6809
6871
  ]
6810
6872
  });
6811
6873
  }
6874
+ function calcCountdownRemaining(targetTime) {
6875
+ var diff = Math.max(0, new Date(targetTime).getTime() - Date.now());
6876
+ return {
6877
+ d: Math.floor(diff / 864e5),
6878
+ h: Math.floor(diff % 864e5 / 36e5),
6879
+ m: Math.floor(diff % 36e5 / 6e4),
6880
+ s: Math.floor(diff % 6e4 / 1e3),
6881
+ expired: diff === 0
6882
+ };
6883
+ }
6812
6884
  function CountdownOverlay(param) {
6813
6885
  var overlay = param.overlay, size = param.size;
6886
+ var _ref;
6814
6887
  var cfg = parseConfig(overlay.content);
6815
- var _useState = _sliced_to_array(useState({
6816
- d: 0,
6817
- h: 0,
6818
- m: 0,
6819
- s: 0
6888
+ var targetTime = (_ref = cfg === null || cfg === void 0 ? void 0 : cfg.targetTime) !== null && _ref !== void 0 ? _ref : "";
6889
+ var _useState = _sliced_to_array(useState(function() {
6890
+ return targetTime ? calcCountdownRemaining(targetTime) : {
6891
+ d: 0,
6892
+ h: 0,
6893
+ m: 0,
6894
+ s: 0,
6895
+ expired: false
6896
+ };
6820
6897
  }), 2), remaining = _useState[0], setRemaining = _useState[1];
6821
6898
  useEffect(function() {
6822
- if (!cfg) return;
6823
- var update = function update() {
6824
- var target = new Date(cfg.targetTime).getTime();
6825
- var now = Date.now();
6826
- var diff = Math.max(0, target - now);
6827
- setRemaining({
6828
- d: Math.floor(diff / 864e5),
6829
- h: Math.floor(diff % 864e5 / 36e5),
6830
- m: Math.floor(diff % 36e5 / 6e4),
6831
- s: Math.floor(diff % 6e4 / 1e3)
6832
- });
6833
- };
6834
- update();
6835
- var id = setInterval(update, 1e3);
6899
+ if (!targetTime) return;
6900
+ setRemaining(calcCountdownRemaining(targetTime));
6901
+ var id = setInterval(function() {
6902
+ return setRemaining(calcCountdownRemaining(targetTime));
6903
+ }, 1e3);
6836
6904
  return function() {
6837
6905
  return clearInterval(id);
6838
6906
  };
6839
6907
  }, [
6840
- cfg === null || cfg === void 0 ? void 0 : cfg.targetTime
6908
+ targetTime
6841
6909
  ]);
6842
6910
  if (!cfg) return null;
6843
6911
  var f = Math.max(6, size.w * 0.055);
@@ -6896,7 +6964,14 @@ function CountdownOverlay(param) {
6896
6964
  },
6897
6965
  children: cfg.eventName
6898
6966
  }),
6899
- /* @__PURE__ */ jsx("div", {
6967
+ remaining.expired ? /* @__PURE__ */ jsx("div", {
6968
+ style: {
6969
+ fontSize: "1em",
6970
+ fontWeight: 700,
6971
+ opacity: 0.6
6972
+ },
6973
+ children: cfg.message || "Event ended"
6974
+ }) : /* @__PURE__ */ jsx("div", {
6900
6975
  style: {
6901
6976
  display: "flex",
6902
6977
  gap: f * 0.6,
@@ -6945,7 +7020,7 @@ function CountdownOverlay(param) {
6945
7020
  }, u.label);
6946
7021
  })
6947
7022
  }),
6948
- cfg.message && /* @__PURE__ */ jsx("div", {
7023
+ !remaining.expired && cfg.message && /* @__PURE__ */ jsx("div", {
6949
7024
  style: {
6950
7025
  fontSize: "0.8em",
6951
7026
  opacity: 0.6,