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/dist/stormcloud-vp.min.js +1 -1
- package/lib/index.cjs +107 -32
- package/lib/index.cjs.map +1 -1
- package/lib/index.js +106 -31
- package/lib/index.js.map +1 -1
- package/lib/ui/OverlayRenderer.cjs +107 -32
- package/lib/ui/OverlayRenderer.cjs.map +1 -1
- package/lib/ui/StormcloudVideoPlayer.cjs +107 -32
- package/lib/ui/StormcloudVideoPlayer.cjs.map +1 -1
- package/package.json +1 -1
|
@@ -6329,15 +6329,38 @@ function ScoreBugOverlay(param) {
|
|
|
6329
6329
|
})
|
|
6330
6330
|
]
|
|
6331
6331
|
}),
|
|
6332
|
-
cfg.sponsorText && /* @__PURE__ */ (0, import_jsx_runtime.
|
|
6332
|
+
(cfg.sponsorText || cfg.sponsorImageUrl) && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
6333
6333
|
style: {
|
|
6334
6334
|
fontSize: "0.7em",
|
|
6335
6335
|
textAlign: "center",
|
|
6336
|
-
opacity: 0.
|
|
6337
|
-
padding: "".concat(f * 0.2, "px 0"),
|
|
6338
|
-
borderTop: "1px solid ".concat(cfg.accentColor, "40")
|
|
6336
|
+
opacity: 0.6,
|
|
6337
|
+
padding: "".concat(f * 0.2, "px ").concat(f * 0.4, "px"),
|
|
6338
|
+
borderTop: "1px solid ".concat(cfg.accentColor, "40"),
|
|
6339
|
+
display: "flex",
|
|
6340
|
+
alignItems: "center",
|
|
6341
|
+
justifyContent: "center",
|
|
6342
|
+
gap: f * 0.4,
|
|
6343
|
+
overflow: "hidden"
|
|
6339
6344
|
},
|
|
6340
|
-
children:
|
|
6345
|
+
children: [
|
|
6346
|
+
cfg.sponsorImageUrl && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
|
|
6347
|
+
src: cfg.sponsorImageUrl,
|
|
6348
|
+
alt: "sponsor",
|
|
6349
|
+
style: {
|
|
6350
|
+
height: "".concat(f * 1.4, "px"),
|
|
6351
|
+
objectFit: "contain",
|
|
6352
|
+
flexShrink: 0
|
|
6353
|
+
}
|
|
6354
|
+
}),
|
|
6355
|
+
cfg.sponsorText && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
6356
|
+
style: {
|
|
6357
|
+
overflow: "hidden",
|
|
6358
|
+
textOverflow: "ellipsis",
|
|
6359
|
+
whiteSpace: "nowrap"
|
|
6360
|
+
},
|
|
6361
|
+
children: cfg.sponsorText
|
|
6362
|
+
})
|
|
6363
|
+
]
|
|
6341
6364
|
})
|
|
6342
6365
|
]
|
|
6343
6366
|
});
|
|
@@ -6399,13 +6422,35 @@ function LowerThirdOverlay(param) {
|
|
|
6399
6422
|
})
|
|
6400
6423
|
]
|
|
6401
6424
|
}),
|
|
6402
|
-
cfg.sponsorText && /* @__PURE__ */ (0, import_jsx_runtime.
|
|
6425
|
+
(cfg.sponsorText || cfg.sponsorImageUrl) && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
6403
6426
|
style: {
|
|
6404
6427
|
fontSize: "0.7em",
|
|
6405
|
-
opacity: 0.
|
|
6406
|
-
padding: "0 ".concat(f * 1.2, "px ").concat(f * 0.4, "px")
|
|
6428
|
+
opacity: 0.5,
|
|
6429
|
+
padding: "0 ".concat(f * 1.2, "px ").concat(f * 0.4, "px"),
|
|
6430
|
+
display: "flex",
|
|
6431
|
+
alignItems: "center",
|
|
6432
|
+
gap: f * 0.4,
|
|
6433
|
+
overflow: "hidden"
|
|
6407
6434
|
},
|
|
6408
|
-
children:
|
|
6435
|
+
children: [
|
|
6436
|
+
cfg.sponsorImageUrl && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
|
|
6437
|
+
src: cfg.sponsorImageUrl,
|
|
6438
|
+
alt: "sponsor",
|
|
6439
|
+
style: {
|
|
6440
|
+
height: "".concat(f * 1.4, "px"),
|
|
6441
|
+
objectFit: "contain",
|
|
6442
|
+
flexShrink: 0
|
|
6443
|
+
}
|
|
6444
|
+
}),
|
|
6445
|
+
cfg.sponsorText && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
6446
|
+
style: {
|
|
6447
|
+
overflow: "hidden",
|
|
6448
|
+
textOverflow: "ellipsis",
|
|
6449
|
+
whiteSpace: "nowrap"
|
|
6450
|
+
},
|
|
6451
|
+
children: cfg.sponsorText
|
|
6452
|
+
})
|
|
6453
|
+
]
|
|
6409
6454
|
})
|
|
6410
6455
|
]
|
|
6411
6456
|
});
|
|
@@ -6562,6 +6607,23 @@ function ComingUpNextOverlay(param) {
|
|
|
6562
6607
|
children: cfg.scheduledTime
|
|
6563
6608
|
})
|
|
6564
6609
|
]
|
|
6610
|
+
}),
|
|
6611
|
+
cfg.thumbnailUrl && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
6612
|
+
style: {
|
|
6613
|
+
flexShrink: 0,
|
|
6614
|
+
width: Math.max(40, size.h * 0.75),
|
|
6615
|
+
overflow: "hidden"
|
|
6616
|
+
},
|
|
6617
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
|
|
6618
|
+
src: cfg.thumbnailUrl,
|
|
6619
|
+
alt: "thumbnail",
|
|
6620
|
+
style: {
|
|
6621
|
+
width: "100%",
|
|
6622
|
+
height: "100%",
|
|
6623
|
+
objectFit: "cover",
|
|
6624
|
+
display: "block"
|
|
6625
|
+
}
|
|
6626
|
+
})
|
|
6565
6627
|
})
|
|
6566
6628
|
]
|
|
6567
6629
|
});
|
|
@@ -6797,35 +6859,41 @@ function BreakingNewsOverlay(param) {
|
|
|
6797
6859
|
]
|
|
6798
6860
|
});
|
|
6799
6861
|
}
|
|
6862
|
+
function calcCountdownRemaining(targetTime) {
|
|
6863
|
+
var diff = Math.max(0, new Date(targetTime).getTime() - Date.now());
|
|
6864
|
+
return {
|
|
6865
|
+
d: Math.floor(diff / 864e5),
|
|
6866
|
+
h: Math.floor(diff % 864e5 / 36e5),
|
|
6867
|
+
m: Math.floor(diff % 36e5 / 6e4),
|
|
6868
|
+
s: Math.floor(diff % 6e4 / 1e3),
|
|
6869
|
+
expired: diff === 0
|
|
6870
|
+
};
|
|
6871
|
+
}
|
|
6800
6872
|
function CountdownOverlay(param) {
|
|
6801
6873
|
var overlay = param.overlay, size = param.size;
|
|
6874
|
+
var _ref;
|
|
6802
6875
|
var cfg = parseConfig(overlay.content);
|
|
6803
|
-
var _ref =
|
|
6804
|
-
|
|
6805
|
-
|
|
6806
|
-
|
|
6807
|
-
|
|
6808
|
-
|
|
6809
|
-
|
|
6810
|
-
|
|
6811
|
-
var update = function update() {
|
|
6812
|
-
var target = new Date(cfg.targetTime).getTime();
|
|
6813
|
-
var now = Date.now();
|
|
6814
|
-
var diff = Math.max(0, target - now);
|
|
6815
|
-
setRemaining({
|
|
6816
|
-
d: Math.floor(diff / 864e5),
|
|
6817
|
-
h: Math.floor(diff % 864e5 / 36e5),
|
|
6818
|
-
m: Math.floor(diff % 36e5 / 6e4),
|
|
6819
|
-
s: Math.floor(diff % 6e4 / 1e3)
|
|
6820
|
-
});
|
|
6876
|
+
var targetTime = (_ref = cfg === null || cfg === void 0 ? void 0 : cfg.targetTime) !== null && _ref !== void 0 ? _ref : "";
|
|
6877
|
+
var _ref1 = _sliced_to_array((0, import_react.useState)(function() {
|
|
6878
|
+
return targetTime ? calcCountdownRemaining(targetTime) : {
|
|
6879
|
+
d: 0,
|
|
6880
|
+
h: 0,
|
|
6881
|
+
m: 0,
|
|
6882
|
+
s: 0,
|
|
6883
|
+
expired: false
|
|
6821
6884
|
};
|
|
6822
|
-
|
|
6823
|
-
|
|
6885
|
+
}), 2), remaining = _ref1[0], setRemaining = _ref1[1];
|
|
6886
|
+
(0, import_react.useEffect)(function() {
|
|
6887
|
+
if (!targetTime) return;
|
|
6888
|
+
setRemaining(calcCountdownRemaining(targetTime));
|
|
6889
|
+
var id = setInterval(function() {
|
|
6890
|
+
return setRemaining(calcCountdownRemaining(targetTime));
|
|
6891
|
+
}, 1e3);
|
|
6824
6892
|
return function() {
|
|
6825
6893
|
return clearInterval(id);
|
|
6826
6894
|
};
|
|
6827
6895
|
}, [
|
|
6828
|
-
|
|
6896
|
+
targetTime
|
|
6829
6897
|
]);
|
|
6830
6898
|
if (!cfg) return null;
|
|
6831
6899
|
var f = Math.max(6, size.w * 0.055);
|
|
@@ -6884,7 +6952,14 @@ function CountdownOverlay(param) {
|
|
|
6884
6952
|
},
|
|
6885
6953
|
children: cfg.eventName
|
|
6886
6954
|
}),
|
|
6887
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
6955
|
+
remaining.expired ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
6956
|
+
style: {
|
|
6957
|
+
fontSize: "1em",
|
|
6958
|
+
fontWeight: 700,
|
|
6959
|
+
opacity: 0.6
|
|
6960
|
+
},
|
|
6961
|
+
children: cfg.message || "Event ended"
|
|
6962
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
6888
6963
|
style: {
|
|
6889
6964
|
display: "flex",
|
|
6890
6965
|
gap: f * 0.6,
|
|
@@ -6933,7 +7008,7 @@ function CountdownOverlay(param) {
|
|
|
6933
7008
|
}, u.label);
|
|
6934
7009
|
})
|
|
6935
7010
|
}),
|
|
6936
|
-
cfg.message && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
7011
|
+
!remaining.expired && cfg.message && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
6937
7012
|
style: {
|
|
6938
7013
|
fontSize: "0.8em",
|
|
6939
7014
|
opacity: 0.6,
|