@geekapps/silo-elements-nextjs 0.1.19 → 0.1.21
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/VideoPlayer.js +60 -13
- package/dist/VideoPlayer.js.map +1 -1
- package/dist/index.js +60 -13
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1430,12 +1430,22 @@ function Video({
|
|
|
1430
1430
|
};
|
|
1431
1431
|
}, []);
|
|
1432
1432
|
useEffect(() => {
|
|
1433
|
+
const video = videoRef.current;
|
|
1433
1434
|
const onFullscreenChange = () => {
|
|
1434
|
-
|
|
1435
|
+
const doc = document;
|
|
1436
|
+
const nativeFullscreen = Boolean(document.fullscreenElement || doc.webkitFullscreenElement);
|
|
1437
|
+
const iosVideoFullscreen = Boolean(video?.webkitDisplayingFullscreen);
|
|
1438
|
+
setIsFullscreen(nativeFullscreen || iosVideoFullscreen);
|
|
1435
1439
|
};
|
|
1436
1440
|
document.addEventListener("fullscreenchange", onFullscreenChange);
|
|
1441
|
+
document.addEventListener("webkitfullscreenchange", onFullscreenChange);
|
|
1442
|
+
video?.addEventListener("webkitbeginfullscreen", onFullscreenChange);
|
|
1443
|
+
video?.addEventListener("webkitendfullscreen", onFullscreenChange);
|
|
1437
1444
|
return () => {
|
|
1438
1445
|
document.removeEventListener("fullscreenchange", onFullscreenChange);
|
|
1446
|
+
document.removeEventListener("webkitfullscreenchange", onFullscreenChange);
|
|
1447
|
+
video?.removeEventListener("webkitbeginfullscreen", onFullscreenChange);
|
|
1448
|
+
video?.removeEventListener("webkitendfullscreen", onFullscreenChange);
|
|
1439
1449
|
};
|
|
1440
1450
|
}, []);
|
|
1441
1451
|
useEffect(() => {
|
|
@@ -1662,13 +1672,44 @@ function Video({
|
|
|
1662
1672
|
}, []);
|
|
1663
1673
|
const toggleFullscreen = useCallback(async () => {
|
|
1664
1674
|
const player = playerRef.current;
|
|
1665
|
-
|
|
1675
|
+
const video = videoRef.current;
|
|
1676
|
+
const doc = document;
|
|
1677
|
+
if (!player && !video) return;
|
|
1666
1678
|
try {
|
|
1667
|
-
|
|
1679
|
+
const nativeFullscreen = Boolean(document.fullscreenElement || doc.webkitFullscreenElement);
|
|
1680
|
+
const iosVideoFullscreen = Boolean(video?.webkitDisplayingFullscreen);
|
|
1681
|
+
if (nativeFullscreen || iosVideoFullscreen) {
|
|
1682
|
+
if (document.fullscreenElement && document.exitFullscreen) {
|
|
1683
|
+
await document.exitFullscreen();
|
|
1684
|
+
return;
|
|
1685
|
+
}
|
|
1686
|
+
if (doc.webkitExitFullscreen) {
|
|
1687
|
+
await doc.webkitExitFullscreen();
|
|
1688
|
+
return;
|
|
1689
|
+
}
|
|
1690
|
+
if (video?.webkitExitFullscreen) {
|
|
1691
|
+
video.webkitExitFullscreen();
|
|
1692
|
+
return;
|
|
1693
|
+
}
|
|
1694
|
+
return;
|
|
1695
|
+
}
|
|
1696
|
+
if (player?.requestFullscreen) {
|
|
1668
1697
|
await player.requestFullscreen();
|
|
1669
|
-
|
|
1670
|
-
|
|
1698
|
+
return;
|
|
1699
|
+
}
|
|
1700
|
+
if (player?.webkitRequestFullscreen) {
|
|
1701
|
+
await player.webkitRequestFullscreen();
|
|
1702
|
+
return;
|
|
1703
|
+
}
|
|
1704
|
+
if (video?.webkitEnterFullscreen) {
|
|
1705
|
+
video.webkitEnterFullscreen();
|
|
1706
|
+
return;
|
|
1707
|
+
}
|
|
1708
|
+
if (video?.requestFullscreen) {
|
|
1709
|
+
await video.requestFullscreen();
|
|
1710
|
+
return;
|
|
1671
1711
|
}
|
|
1712
|
+
throw new Error("Fullscreen unavailable");
|
|
1672
1713
|
} catch {
|
|
1673
1714
|
setError("N\xE3o foi poss\xEDvel alterar o modo fullscreen.");
|
|
1674
1715
|
}
|
|
@@ -1878,14 +1919,6 @@ function Video({
|
|
|
1878
1919
|
}
|
|
1879
1920
|
)
|
|
1880
1921
|
] }),
|
|
1881
|
-
activeCue && /* @__PURE__ */ jsx("div", { className: "pointer-events-none relative z-10 flex justify-center px-4 pb-3 @sm:pb-4", children: /* @__PURE__ */ jsx(
|
|
1882
|
-
"div",
|
|
1883
|
-
{
|
|
1884
|
-
className: "max-w-3xl rounded-lg bg-black/70 px-4 py-2 text-center text-sm font-medium leading-snug text-white backdrop-blur-sm @sm:text-base @lg:text-lg",
|
|
1885
|
-
style: { textShadow: "0 1px 4px rgba(0,0,0,0.8)" },
|
|
1886
|
-
children: activeCue
|
|
1887
|
-
}
|
|
1888
|
-
) }),
|
|
1889
1922
|
/* @__PURE__ */ jsxs("footer", { onClick: (e) => e.stopPropagation(), className: "relative z-10 px-3 pb-3 text-white @sm:px-5 @sm:pb-5 @lg:px-9 @lg:pb-8", children: [
|
|
1890
1923
|
/* @__PURE__ */ jsxs(
|
|
1891
1924
|
"div",
|
|
@@ -2096,6 +2129,20 @@ function Video({
|
|
|
2096
2129
|
] })
|
|
2097
2130
|
]
|
|
2098
2131
|
}
|
|
2132
|
+
),
|
|
2133
|
+
activeCue && /* @__PURE__ */ jsx(
|
|
2134
|
+
"div",
|
|
2135
|
+
{
|
|
2136
|
+
className: `pointer-events-none absolute inset-x-0 z-40 flex justify-center px-4 transition-all duration-200 ${controlsVisible ? "bottom-20 @sm:bottom-24 @lg:bottom-28" : "bottom-4 @sm:bottom-6"}`,
|
|
2137
|
+
children: /* @__PURE__ */ jsx(
|
|
2138
|
+
"div",
|
|
2139
|
+
{
|
|
2140
|
+
className: "max-w-3xl rounded-lg bg-black/75 px-4 py-2 text-center text-sm font-medium leading-snug text-white backdrop-blur-sm @sm:text-base @lg:text-lg",
|
|
2141
|
+
style: { textShadow: "0 1px 4px rgba(0,0,0,0.9)" },
|
|
2142
|
+
children: activeCue
|
|
2143
|
+
}
|
|
2144
|
+
)
|
|
2145
|
+
}
|
|
2099
2146
|
)
|
|
2100
2147
|
]
|
|
2101
2148
|
}
|