@geekapps/silo-elements-nextjs 0.3.1 → 0.3.3
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/FileUploader.js +179 -30
- package/dist/FileUploader.js.map +1 -1
- package/dist/MediaUploader.js +179 -30
- package/dist/MediaUploader.js.map +1 -1
- package/dist/VideoPlayer.js +10 -9
- package/dist/VideoPlayer.js.map +1 -1
- package/dist/VideoUploader.js +179 -30
- package/dist/VideoUploader.js.map +1 -1
- package/dist/index.js +189 -39
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +2 -2
- package/styles.css +1 -1
package/dist/VideoPlayer.js
CHANGED
|
@@ -183,6 +183,8 @@ function Video({
|
|
|
183
183
|
const ageRatingWrapRef = useRef(null);
|
|
184
184
|
const ageRatingIconRef = useRef(null);
|
|
185
185
|
const ageRatingTextRef = useRef(null);
|
|
186
|
+
const ageRatingShownRef = useRef(false);
|
|
187
|
+
const ageRatingQueuedRef = useRef(false);
|
|
186
188
|
const [clickIcon, setClickIcon] = useState(null);
|
|
187
189
|
const clickIconTimerRef = useRef(null);
|
|
188
190
|
const clickIconRef = useRef(null);
|
|
@@ -257,9 +259,6 @@ function Video({
|
|
|
257
259
|
setControlsVisible(false);
|
|
258
260
|
}, 2400);
|
|
259
261
|
}
|
|
260
|
-
if (video?.paused) {
|
|
261
|
-
showAgeRatingRef.current?.();
|
|
262
|
-
}
|
|
263
262
|
}, [autoHideControls]);
|
|
264
263
|
useEffect(() => {
|
|
265
264
|
if (!containerRef.current) return;
|
|
@@ -430,7 +429,9 @@ function Video({
|
|
|
430
429
|
);
|
|
431
430
|
}
|
|
432
431
|
tl.to({}, { duration: HOLD });
|
|
433
|
-
tl.to(wrap, { opacity: 0, duration: 0.7, ease: "power2.inOut"
|
|
432
|
+
tl.to(wrap, { opacity: 0, duration: 0.7, ease: "power2.inOut", onComplete: () => {
|
|
433
|
+
ageRatingShownRef.current = true;
|
|
434
|
+
} });
|
|
434
435
|
ageRatingTlRef.current = tl;
|
|
435
436
|
};
|
|
436
437
|
showAgeRatingRef.current = showAgeRating;
|
|
@@ -440,10 +441,10 @@ function Video({
|
|
|
440
441
|
window.clearTimeout(ageRatingPauseTimerRef.current);
|
|
441
442
|
ageRatingPauseTimerRef.current = null;
|
|
442
443
|
}
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
444
|
+
const shouldShow = !ageRatingShownRef.current || ageRatingQueuedRef.current;
|
|
445
|
+
ageRatingQueuedRef.current = false;
|
|
446
|
+
if (shouldShow) showAgeRating();
|
|
447
|
+
setHasPlayed(true);
|
|
447
448
|
showControlsTemporarily();
|
|
448
449
|
};
|
|
449
450
|
const onPause = () => {
|
|
@@ -453,7 +454,7 @@ function Video({
|
|
|
453
454
|
if (parsed.ageRating?.data) {
|
|
454
455
|
if (ageRatingPauseTimerRef.current) window.clearTimeout(ageRatingPauseTimerRef.current);
|
|
455
456
|
ageRatingPauseTimerRef.current = window.setTimeout(() => {
|
|
456
|
-
|
|
457
|
+
ageRatingQueuedRef.current = true;
|
|
457
458
|
ageRatingPauseTimerRef.current = null;
|
|
458
459
|
}, 60 * 1e3);
|
|
459
460
|
}
|