@xhub-reels/sdk 0.1.17 → 0.1.18
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/index.cjs +5 -3
- package/dist/index.js +5 -3
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1947,6 +1947,7 @@ function VideoSlotInner({
|
|
|
1947
1947
|
video.muted = isActive ? isMuted : true;
|
|
1948
1948
|
}, [isMuted, isActive]);
|
|
1949
1949
|
const showPosterOverlay = !isReady && !hasPlayedAhead;
|
|
1950
|
+
const isPreDecoded = hasPlayedAhead;
|
|
1950
1951
|
const [showMuteIndicator, setShowMuteIndicator] = react.useState(false);
|
|
1951
1952
|
const muteIndicatorTimer = react.useRef(null);
|
|
1952
1953
|
const handleToggleMute = react.useCallback(() => {
|
|
@@ -2062,13 +2063,14 @@ function VideoSlotInner({
|
|
|
2062
2063
|
width: "100%",
|
|
2063
2064
|
height: "100%",
|
|
2064
2065
|
objectFit: "cover",
|
|
2065
|
-
// Hide video until ready to avoid black frame flash
|
|
2066
|
+
// Hide video until ready to avoid black frame flash.
|
|
2067
|
+
// When pre-decoded, skip transition — first frame is already on canvas.
|
|
2066
2068
|
opacity: showPosterOverlay ? 0 : 1,
|
|
2067
|
-
transition: "opacity 0.15s ease"
|
|
2069
|
+
transition: isPreDecoded ? "none" : "opacity 0.15s ease"
|
|
2068
2070
|
}
|
|
2069
2071
|
}
|
|
2070
2072
|
),
|
|
2071
|
-
item.poster && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2073
|
+
item.poster && !isPreDecoded && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2072
2074
|
"div",
|
|
2073
2075
|
{
|
|
2074
2076
|
style: {
|
package/dist/index.js
CHANGED
|
@@ -1941,6 +1941,7 @@ function VideoSlotInner({
|
|
|
1941
1941
|
video.muted = isActive ? isMuted : true;
|
|
1942
1942
|
}, [isMuted, isActive]);
|
|
1943
1943
|
const showPosterOverlay = !isReady && !hasPlayedAhead;
|
|
1944
|
+
const isPreDecoded = hasPlayedAhead;
|
|
1944
1945
|
const [showMuteIndicator, setShowMuteIndicator] = useState(false);
|
|
1945
1946
|
const muteIndicatorTimer = useRef(null);
|
|
1946
1947
|
const handleToggleMute = useCallback(() => {
|
|
@@ -2056,13 +2057,14 @@ function VideoSlotInner({
|
|
|
2056
2057
|
width: "100%",
|
|
2057
2058
|
height: "100%",
|
|
2058
2059
|
objectFit: "cover",
|
|
2059
|
-
// Hide video until ready to avoid black frame flash
|
|
2060
|
+
// Hide video until ready to avoid black frame flash.
|
|
2061
|
+
// When pre-decoded, skip transition — first frame is already on canvas.
|
|
2060
2062
|
opacity: showPosterOverlay ? 0 : 1,
|
|
2061
|
-
transition: "opacity 0.15s ease"
|
|
2063
|
+
transition: isPreDecoded ? "none" : "opacity 0.15s ease"
|
|
2062
2064
|
}
|
|
2063
2065
|
}
|
|
2064
2066
|
),
|
|
2065
|
-
item.poster && /* @__PURE__ */ jsx(
|
|
2067
|
+
item.poster && !isPreDecoded && /* @__PURE__ */ jsx(
|
|
2066
2068
|
"div",
|
|
2067
2069
|
{
|
|
2068
2070
|
style: {
|