stormcloud-video-player 0.7.7 → 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.
@@ -409,15 +409,38 @@ function ScoreBugOverlay(param) {
409
409
  })
410
410
  ]
411
411
  }),
412
- cfg.sponsorText && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
412
+ (cfg.sponsorText || cfg.sponsorImageUrl) && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
413
413
  style: {
414
414
  fontSize: "0.7em",
415
415
  textAlign: "center",
416
- opacity: 0.5,
417
- padding: "".concat(f * 0.2, "px 0"),
418
- borderTop: "1px solid ".concat(cfg.accentColor, "40")
416
+ opacity: 0.6,
417
+ padding: "".concat(f * 0.2, "px ").concat(f * 0.4, "px"),
418
+ borderTop: "1px solid ".concat(cfg.accentColor, "40"),
419
+ display: "flex",
420
+ alignItems: "center",
421
+ justifyContent: "center",
422
+ gap: f * 0.4,
423
+ overflow: "hidden"
419
424
  },
420
- children: cfg.sponsorText
425
+ children: [
426
+ cfg.sponsorImageUrl && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
427
+ src: cfg.sponsorImageUrl,
428
+ alt: "sponsor",
429
+ style: {
430
+ height: "".concat(f * 1.4, "px"),
431
+ objectFit: "contain",
432
+ flexShrink: 0
433
+ }
434
+ }),
435
+ cfg.sponsorText && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
436
+ style: {
437
+ overflow: "hidden",
438
+ textOverflow: "ellipsis",
439
+ whiteSpace: "nowrap"
440
+ },
441
+ children: cfg.sponsorText
442
+ })
443
+ ]
421
444
  })
422
445
  ]
423
446
  });
@@ -479,13 +502,35 @@ function LowerThirdOverlay(param) {
479
502
  })
480
503
  ]
481
504
  }),
482
- cfg.sponsorText && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
505
+ (cfg.sponsorText || cfg.sponsorImageUrl) && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
483
506
  style: {
484
507
  fontSize: "0.7em",
485
- opacity: 0.4,
486
- padding: "0 ".concat(f * 1.2, "px ").concat(f * 0.4, "px")
508
+ opacity: 0.5,
509
+ padding: "0 ".concat(f * 1.2, "px ").concat(f * 0.4, "px"),
510
+ display: "flex",
511
+ alignItems: "center",
512
+ gap: f * 0.4,
513
+ overflow: "hidden"
487
514
  },
488
- children: cfg.sponsorText
515
+ children: [
516
+ cfg.sponsorImageUrl && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
517
+ src: cfg.sponsorImageUrl,
518
+ alt: "sponsor",
519
+ style: {
520
+ height: "".concat(f * 1.4, "px"),
521
+ objectFit: "contain",
522
+ flexShrink: 0
523
+ }
524
+ }),
525
+ cfg.sponsorText && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
526
+ style: {
527
+ overflow: "hidden",
528
+ textOverflow: "ellipsis",
529
+ whiteSpace: "nowrap"
530
+ },
531
+ children: cfg.sponsorText
532
+ })
533
+ ]
489
534
  })
490
535
  ]
491
536
  });
@@ -642,6 +687,23 @@ function ComingUpNextOverlay(param) {
642
687
  children: cfg.scheduledTime
643
688
  })
644
689
  ]
690
+ }),
691
+ cfg.thumbnailUrl && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
692
+ style: {
693
+ flexShrink: 0,
694
+ width: Math.max(40, size.h * 0.75),
695
+ overflow: "hidden"
696
+ },
697
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
698
+ src: cfg.thumbnailUrl,
699
+ alt: "thumbnail",
700
+ style: {
701
+ width: "100%",
702
+ height: "100%",
703
+ objectFit: "cover",
704
+ display: "block"
705
+ }
706
+ })
645
707
  })
646
708
  ]
647
709
  });
@@ -877,35 +939,41 @@ function BreakingNewsOverlay(param) {
877
939
  ]
878
940
  });
879
941
  }
942
+ function calcCountdownRemaining(targetTime) {
943
+ var diff = Math.max(0, new Date(targetTime).getTime() - Date.now());
944
+ return {
945
+ d: Math.floor(diff / 864e5),
946
+ h: Math.floor(diff % 864e5 / 36e5),
947
+ m: Math.floor(diff % 36e5 / 6e4),
948
+ s: Math.floor(diff % 6e4 / 1e3),
949
+ expired: diff === 0
950
+ };
951
+ }
880
952
  function CountdownOverlay(param) {
881
953
  var overlay = param.overlay, size = param.size;
954
+ var _ref;
882
955
  var cfg = parseConfig(overlay.content);
883
- var _ref = _sliced_to_array((0, import_react.useState)({
884
- d: 0,
885
- h: 0,
886
- m: 0,
887
- s: 0
888
- }), 2), remaining = _ref[0], setRemaining = _ref[1];
889
- (0, import_react.useEffect)(function() {
890
- if (!cfg) return;
891
- var update = function update() {
892
- var target = new Date(cfg.targetTime).getTime();
893
- var now = Date.now();
894
- var diff = Math.max(0, target - now);
895
- setRemaining({
896
- d: Math.floor(diff / 864e5),
897
- h: Math.floor(diff % 864e5 / 36e5),
898
- m: Math.floor(diff % 36e5 / 6e4),
899
- s: Math.floor(diff % 6e4 / 1e3)
900
- });
956
+ var targetTime = (_ref = cfg === null || cfg === void 0 ? void 0 : cfg.targetTime) !== null && _ref !== void 0 ? _ref : "";
957
+ var _ref1 = _sliced_to_array((0, import_react.useState)(function() {
958
+ return targetTime ? calcCountdownRemaining(targetTime) : {
959
+ d: 0,
960
+ h: 0,
961
+ m: 0,
962
+ s: 0,
963
+ expired: false
901
964
  };
902
- update();
903
- var id = setInterval(update, 1e3);
965
+ }), 2), remaining = _ref1[0], setRemaining = _ref1[1];
966
+ (0, import_react.useEffect)(function() {
967
+ if (!targetTime) return;
968
+ setRemaining(calcCountdownRemaining(targetTime));
969
+ var id = setInterval(function() {
970
+ return setRemaining(calcCountdownRemaining(targetTime));
971
+ }, 1e3);
904
972
  return function() {
905
973
  return clearInterval(id);
906
974
  };
907
975
  }, [
908
- cfg === null || cfg === void 0 ? void 0 : cfg.targetTime
976
+ targetTime
909
977
  ]);
910
978
  if (!cfg) return null;
911
979
  var f = Math.max(6, size.w * 0.055);
@@ -964,7 +1032,14 @@ function CountdownOverlay(param) {
964
1032
  },
965
1033
  children: cfg.eventName
966
1034
  }),
967
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
1035
+ remaining.expired ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
1036
+ style: {
1037
+ fontSize: "1em",
1038
+ fontWeight: 700,
1039
+ opacity: 0.6
1040
+ },
1041
+ children: cfg.message || "Event ended"
1042
+ }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
968
1043
  style: {
969
1044
  display: "flex",
970
1045
  gap: f * 0.6,
@@ -1013,7 +1088,7 @@ function CountdownOverlay(param) {
1013
1088
  }, u.label);
1014
1089
  })
1015
1090
  }),
1016
- cfg.message && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
1091
+ !remaining.expired && cfg.message && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
1017
1092
  style: {
1018
1093
  fontSize: "0.8em",
1019
1094
  opacity: 0.6,