Skip to content

🎥 Make videos programmatically with React

deps

Jonny Burger9b475e873de7
diff --git a/packages/core/src/no-react.ts b/packages/core/src/no-react.ts
index dc46324b58..8609808234 100644
--- a/packages/core/src/no-react.ts
+++ b/packages/core/src/no-react.ts
@@ -8,6 +8,7 @@ export {
export type {ClipRegion} from './NativeLayers';
export {random, RandomSeed} from './random.js';
export type {VideoConfig} from './video-config';
+import {getAbsoluteSrc} from './absolute-src';
import {DELAY_RENDER_CALLSTACK_TOKEN} from './delay-render';
import {
deserializeJSONWithCustomFields,
@@ -34,4 +35,5 @@ export const NoReactInternals = {
bundleMapName: 'bundle.js.map',
deserializeJSONWithCustomFields,
DELAY_RENDER_CALLSTACK_TOKEN,
+ getAbsoluteSrc,
};
diff --git a/packages/three/package.json b/packages/three/package.json
index 73a2f33f63..63d0d11ff0 100644
--- a/packages/three/package.json
+++ b/packages/three/package.json
@@ -28,7 +28,9 @@
"@react-three/fiber": ">=8.0.0",
"react": ">=16.8.0",
"react-dom": ">=16.8.0",
- "three": ">=0.137.0"
+ "three": ">=0.137.0",
+ "remotion": "workspace:*",
+ "@remotion/media-utils": "workspace:*"
},
"devDependencies": {
"@jonny/eslint-config": "3.0.276",
@@ -43,6 +45,8 @@
"prettier": "3.0.2",
"prettier-plugin-organize-imports": "^3.2.2",
"react": "18.2.0",
+ "remotion": "workspace:*",
+ "@remotion/media-utils": "workspace:*",
"react-dom": "18.2.0",
"rollup": "^2.70.1",
"three": "0.158.0"
diff --git a/packages/three/src/use-offthread-video-texture.ts b/packages/three/src/use-offthread-video-texture.ts
index 8f00987638..db7e056564 100644
--- a/packages/three/src/use-offthread-video-texture.ts
+++ b/packages/three/src/use-offthread-video-texture.ts
@@ -7,7 +7,7 @@ import {
useCurrentFrame,
useVideoConfig,
} from 'remotion';
-import {getAbsoluteSrc} from 'remotion/src/absolute-src';
+import {NoReactInternals} from 'remotion/no-react';
import {getExpectedMediaFrameUncorrected} from 'remotion/src/video/get-current-time';
import * as THREE from 'three';
import {getVideoMetadata} from '../../media-utils';
@@ -121,7 +121,7 @@ export function useOffthreadVideoTexture({
return `http://localhost:${
window.remotion_proxyPort
}/proxy?src=${encodeURIComponent(
- getAbsoluteSrc(src),
+ NoReactInternals.getAbsoluteSrc(src),
)}&time=${encodeURIComponent(currentTime)}&transparent=${String(false)}`;
}, [currentTime, src]);
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 0844dd1a34..2063329a77 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -1875,6 +1875,9 @@ importers:
'@react-three/fiber':
specifier: 8.13.5
+ '@remotion/media-utils':
+ specifier: workspace:*
+ version: link:../media-utils
'@rollup/plugin-typescript':
specifier: ^8.2.0