stormcloud-video-player 0.7.45 → 0.7.47
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 +30 -8
- package/lib/index.cjs.map +1 -1
- package/lib/index.js +28 -6
- package/lib/index.js.map +1 -1
- package/lib/ui/OverlayRenderer.cjs +24 -4
- package/lib/ui/OverlayRenderer.cjs.map +1 -1
- package/lib/ui/StormcloudVideoPlayer.cjs +30 -8
- package/lib/ui/StormcloudVideoPlayer.cjs.map +1 -1
- package/package.json +1 -1
package/lib/index.cjs
CHANGED
|
@@ -7383,7 +7383,8 @@ var SHOWCASE_PERSISTENT_TYPES = /* @__PURE__ */ new Set([
|
|
|
7383
7383
|
"text",
|
|
7384
7384
|
"shape",
|
|
7385
7385
|
"countdown",
|
|
7386
|
-
"qr_code"
|
|
7386
|
+
"qr_code",
|
|
7387
|
+
"coming_up_next"
|
|
7387
7388
|
]);
|
|
7388
7389
|
function easeOutCubic(t) {
|
|
7389
7390
|
var u = 1 - t;
|
|
@@ -7506,11 +7507,26 @@ var OverlayRenderer = function OverlayRenderer(param) {
|
|
|
7506
7507
|
var rafRef = (0, import_react.useRef)(null);
|
|
7507
7508
|
var _ref1 = _sliced_to_array((0, import_react.useState)(/* @__PURE__ */ new Map()), 2), fadeMap = _ref1[0], setFadeMap = _ref1[1];
|
|
7508
7509
|
var removeTimers = (0, import_react.useRef)(/* @__PURE__ */ new Map());
|
|
7509
|
-
var
|
|
7510
|
+
var mountTimeRef = (0, import_react.useRef)(Date.now());
|
|
7511
|
+
var _ref2 = _sliced_to_array((0, import_react.useState)(0), 2), wallclockSec = _ref2[0], setWallclockSec = _ref2[1];
|
|
7512
|
+
(0, import_react.useEffect)(function() {
|
|
7513
|
+
if (!showcaseMode) return;
|
|
7514
|
+
var tick = function tick() {
|
|
7515
|
+
return setWallclockSec((Date.now() - mountTimeRef.current) / 1e3);
|
|
7516
|
+
};
|
|
7517
|
+
tick();
|
|
7518
|
+
var id = window.setInterval(tick, 200);
|
|
7519
|
+
return function() {
|
|
7520
|
+
return clearInterval(id);
|
|
7521
|
+
};
|
|
7522
|
+
}, [
|
|
7523
|
+
showcaseMode
|
|
7524
|
+
]);
|
|
7525
|
+
var _ref3 = (0, import_react.useMemo)(function() {
|
|
7510
7526
|
return partitionShowcase(overlays);
|
|
7511
7527
|
}, [
|
|
7512
7528
|
overlays
|
|
7513
|
-
]), showcasePersistent =
|
|
7529
|
+
]), showcasePersistent = _ref3.persistent, showcaseBeats = _ref3.beats;
|
|
7514
7530
|
var _useShowcaseBeat = useShowcaseBeat(showcaseMode, showcaseCycleMs, showcaseBeats.length), showcaseBeatIndex = _useShowcaseBeat.beatIndex, showcaseBeatPhase = _useShowcaseBeat.beatPhase, showcaseBeatMs = _useShowcaseBeat.beatMs;
|
|
7515
7531
|
var showcasePersistentIds = (0, import_react.useMemo)(function() {
|
|
7516
7532
|
return new Set(showcasePersistent.map(function(o) {
|
|
@@ -7562,7 +7578,10 @@ var OverlayRenderer = function OverlayRenderer(param) {
|
|
|
7562
7578
|
if (showcaseMode) {
|
|
7563
7579
|
var _showcaseBeats_showcaseBeatIndex;
|
|
7564
7580
|
var beat = (_showcaseBeats_showcaseBeatIndex = showcaseBeats[showcaseBeatIndex]) !== null && _showcaseBeats_showcaseBeatIndex !== void 0 ? _showcaseBeats_showcaseBeatIndex : [];
|
|
7565
|
-
|
|
7581
|
+
var scheduledPersistent = showcasePersistent.filter(function(o) {
|
|
7582
|
+
return isOverlayActive(o, wallclockSec);
|
|
7583
|
+
});
|
|
7584
|
+
return _to_consumable_array(scheduledPersistent).concat(_to_consumable_array(beat));
|
|
7566
7585
|
}
|
|
7567
7586
|
return overlays.filter(function(o) {
|
|
7568
7587
|
return isOverlayActive(o, currentTime);
|
|
@@ -7570,6 +7589,7 @@ var OverlayRenderer = function OverlayRenderer(param) {
|
|
|
7570
7589
|
}, [
|
|
7571
7590
|
overlays,
|
|
7572
7591
|
currentTime,
|
|
7592
|
+
wallclockSec,
|
|
7573
7593
|
showcaseMode,
|
|
7574
7594
|
showcasePersistent,
|
|
7575
7595
|
showcaseBeats,
|
|
@@ -8282,6 +8302,7 @@ var StormcloudVideoPlayerComponent = import_react2.default.memo(function(props)
|
|
|
8282
8302
|
var _player_getMinHlsResolution;
|
|
8283
8303
|
var fixed = swirlOverlayCoordinateSpace;
|
|
8284
8304
|
if (fixed && fixed.width > 0 && fixed.height > 0) {
|
|
8305
|
+
console.debug("[StormcloudVideoPlayer] overlay coord space (prop):", fixed.width, "x", fixed.height);
|
|
8285
8306
|
setOverlayCoordSpace({
|
|
8286
8307
|
width: fixed.width,
|
|
8287
8308
|
height: fixed.height
|
|
@@ -8292,6 +8313,7 @@ var StormcloudVideoPlayerComponent = import_react2.default.memo(function(props)
|
|
|
8292
8313
|
if (!player) return false;
|
|
8293
8314
|
var minRes = (_player_getMinHlsResolution = player.getMinHlsResolution) === null || _player_getMinHlsResolution === void 0 ? void 0 : _player_getMinHlsResolution.call(player);
|
|
8294
8315
|
if (minRes && minRes.width > 0 && minRes.height > 0) {
|
|
8316
|
+
console.debug("[StormcloudVideoPlayer] overlay coord space (minHlsResolution):", minRes.width, "x", minRes.height);
|
|
8295
8317
|
setOverlayCoordSpace({
|
|
8296
8318
|
width: minRes.width,
|
|
8297
8319
|
height: minRes.height
|
|
@@ -8300,6 +8322,7 @@ var StormcloudVideoPlayerComponent = import_react2.default.memo(function(props)
|
|
|
8300
8322
|
}
|
|
8301
8323
|
var video2 = player.videoElement;
|
|
8302
8324
|
if (video2 && video2.videoWidth > 0 && video2.videoHeight > 0) {
|
|
8325
|
+
console.debug("[StormcloudVideoPlayer] overlay coord space (videoNative):", video2.videoWidth, "x", video2.videoHeight);
|
|
8303
8326
|
setOverlayCoordSpace({
|
|
8304
8327
|
width: video2.videoWidth,
|
|
8305
8328
|
height: video2.videoHeight
|
|
@@ -8332,8 +8355,7 @@ var StormcloudVideoPlayerComponent = import_react2.default.memo(function(props)
|
|
|
8332
8355
|
}, [
|
|
8333
8356
|
swirlProjectId,
|
|
8334
8357
|
criticalPropsKey,
|
|
8335
|
-
swirlOverlayCoordinateSpace
|
|
8336
|
-
overlays
|
|
8358
|
+
swirlOverlayCoordinateSpace
|
|
8337
8359
|
]);
|
|
8338
8360
|
(0, import_react2.useEffect)(function() {
|
|
8339
8361
|
if (!playerRef.current) return;
|
|
@@ -8760,11 +8782,11 @@ var StormcloudVideoPlayerComponent = import_react2.default.memo(function(props)
|
|
|
8760
8782
|
}, restVideoAttrs), {
|
|
8761
8783
|
children: children
|
|
8762
8784
|
})),
|
|
8763
|
-
displayOverlays.length > 0 && !adStatus.showAds && !overlaysDisabled && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(OverlayRenderer, {
|
|
8785
|
+
displayOverlays.length > 0 && !adStatus.showAds && !overlaysDisabled && overlayCoordSpace && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(OverlayRenderer, {
|
|
8764
8786
|
overlays: displayOverlays,
|
|
8765
8787
|
currentTime: currentTime,
|
|
8766
8788
|
videoRef: videoRef,
|
|
8767
|
-
coordinateSpace:
|
|
8789
|
+
coordinateSpace: overlayCoordSpace,
|
|
8768
8790
|
showcaseMode: !!swirlShowcaseDemo
|
|
8769
8791
|
}),
|
|
8770
8792
|
(isLoading || isBuffering) && !hideLoadingIndicator && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|