@cntrl-site/sdk-nextjs 1.3.0 → 1.3.1
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.
|
@@ -14,7 +14,10 @@ function useVideoFx(canvas, enabled, { videoUrl, fragmentShader, cursor, control
|
|
|
14
14
|
const videoTextureManager = (0, react_1.useMemo)(() => {
|
|
15
15
|
if (!videoUrl || !enabled)
|
|
16
16
|
return;
|
|
17
|
-
|
|
17
|
+
const handlePlayError = () => {
|
|
18
|
+
setIsFXAllowed(false);
|
|
19
|
+
};
|
|
20
|
+
return new effects_1.VideoTextureManager(videoUrl, handlePlayError);
|
|
18
21
|
}, [videoUrl, enabled]);
|
|
19
22
|
const videoFx = (0, react_1.useMemo)(() => {
|
|
20
23
|
if (!cursor || !videoTextureManager)
|
package/package.json
CHANGED
|
@@ -36,7 +36,10 @@ export function useVideoFx(
|
|
|
36
36
|
const mousePos = useRef<[number, number]>([0.0, 0.0]);
|
|
37
37
|
const videoTextureManager = useMemo(() => {
|
|
38
38
|
if (!videoUrl || !enabled) return;
|
|
39
|
-
|
|
39
|
+
const handlePlayError = () => {
|
|
40
|
+
setIsFXAllowed(false);
|
|
41
|
+
};
|
|
42
|
+
return new VideoTextureManager(videoUrl, handlePlayError);
|
|
40
43
|
}, [videoUrl, enabled]);
|
|
41
44
|
const videoFx = useMemo<MediaEffect | undefined>(() => {
|
|
42
45
|
if (!cursor || !videoTextureManager) return;
|