Skip to content

🎥 Make videos programmatically with React

add a bugfix for use-video-texture

Jonny Burgerd4666fd0edce
diff --git a/packages/three/src/use-video-texture.ts b/packages/three/src/use-video-texture.ts
index f5c89fc430..b31cf90ac5 100644
--- a/packages/three/src/use-video-texture.ts
+++ b/packages/three/src/use-video-texture.ts
@@ -82,7 +82,11 @@ export const useVideoTexture = (
current.requestVideoFrameCallback(ready);
}, [frame, loaded, videoRef]);
- if (!HTMLVideoElement.prototype.requestVideoFrameCallback) {
+ if (
+ typeof HTMLVideoElement !== 'undefined' &&
+ !HTMLVideoElement.prototype.requestVideoFrameCallback
+ ) {
+ continueRender(loaded);
return null;
}