Skip to content

🎥 Make videos programmatically with React

replaced internals

Patric Salvisberg487dabfd7b55
diff --git a/packages/bundler/src/renderEntry.tsx b/packages/bundler/src/renderEntry.tsx
index 47942d5e90..5807b02b2c 100644
--- a/packages/bundler/src/renderEntry.tsx
+++ b/packages/bundler/src/renderEntry.tsx
@@ -14,6 +14,7 @@ import {
continueRender,
delayRender,
getInputProps,
+ getRemotionEnvironment,
Internals,
VERSION,
} from 'remotion';
@@ -282,8 +283,7 @@ if (typeof window !== 'undefined') {
const compositions = getUnevaluatedComps();
const inputProps =
- typeof window === 'undefined' ||
- Internals.getRemotionEnvironment().isPlayer
+ typeof window === 'undefined' || getRemotionEnvironment().isPlayer
? {}
: getInputProps() ?? {};
@@ -340,8 +340,7 @@ if (typeof window !== 'undefined') {
);
const inputProps =
- typeof window === 'undefined' ||
- Internals.getRemotionEnvironment().isPlayer
+ typeof window === 'undefined' || getRemotionEnvironment().isPlayer
? {}
: getInputProps() ?? {};
diff --git a/packages/docs/docs/data-fetching.md b/packages/docs/docs/data-fetching.md
index 16c278cdee..012d182bcd 100644
--- a/packages/docs/docs/data-fetching.md
+++ b/packages/docs/docs/data-fetching.md
@@ -299,11 +299,9 @@ This `abortSignal` is created by Remotion using the [`AbortController`](https://
If you are making requests to an expensive API, you might want to only fire a request after the user has stopped typing for a while. You may use the following function for doing so:
```tsx twoslash title="src/wait-for-no-input.ts"
-import { Internals } from "remotion";
-
export const waitForNoInput = (signal: AbortSignal, ms: number) => {
// Don't wait during rendering
- if (Internals.getRemotionEnvironment() === "rendering") {
+ if (getRemotionEnvironment() === "rendering") {
return Promise.resolve();
}
@@ -327,11 +325,11 @@ export const waitForNoInput = (signal: AbortSignal, ms: number) => {
```
```tsx twoslash title="src/MyComp.tsx" {4}
-import { CalculateMetadataFunction, Internals } from "remotion";
+import { CalculateMetadataFunction } from "remotion";
const waitForNoInput = (signal: AbortSignal, ms: number) => {
// Don't wait during rendering
- if (Internals.getRemotionEnvironment() === "rendering") {
+ if (getRemotionEnvironment() === "rendering") {
return Promise.resolve();
}
diff --git a/packages/gif/src/get-gif-duration-in-seconds.ts b/packages/gif/src/get-gif-duration-in-seconds.ts
index 7e8ce87dea..3e888bea4f 100644
--- a/packages/gif/src/get-gif-duration-in-seconds.ts
+++ b/packages/gif/src/get-gif-duration-in-seconds.ts
@@ -1,4 +1,4 @@
-import {Internals} from 'remotion';
+import {getRemotionEnvironment} from 'remotion';
import {manuallyManagedGifCache, volatileGifCache} from './gif-cache';
import type {GifState} from './props';
import {parseGif, parseWithWorker} from './react-tools';
@@ -22,7 +22,7 @@ export const getGifDurationInSeconds = async (src: string) => {
return calcDuration(inCache);
}
- if (Internals.getRemotionEnvironment().isRendering) {
+ if (getRemotionEnvironment().isRendering) {
const renderingParsed = parseWithWorker(resolvedSrc);
const resolved = await renderingParsed.prom;
volatileGifCache.set(resolvedSrc, resolved);