Skip to content

🎥 Make videos programmatically with React

fair..

Jonny Burgercdc5b3c5dca9
diff --git a/.oxfmtrc.json b/.oxfmtrc.json
index 6fa5f721a4..15861903d1 100644
--- a/.oxfmtrc.json
+++ b/.oxfmtrc.json
@@ -8,7 +8,6 @@
"sortPackageJson": false,
"ignorePatterns": [
"packages/template-*/**",
- "packages/example/**",
"packages/player-example/**",
"packages/example-videos/**"
],
diff --git a/packages/example/package.json b/packages/example/package.json
index 50a56a7e86..6b5023bd60 100644
--- a/packages/example/package.json
+++ b/packages/example/package.json
@@ -12,7 +12,7 @@
"dist"
],
"scripts": {
- "formatting": "prettier src --check",
+ "formatting": "oxfmt src --check",
"dev": "remotion studio --props src/my-props.json",
"start-bun": "PATCH_BUN_DEVELOPMENT=true bun --bun remotion studio",
"start-js": "remotion preview src/entry.jsx",
@@ -86,7 +86,6 @@
"lottie-web": "5.13.0",
"opentype.js": "^1.3.4",
"polished": "^4.0.5",
- "prettier": "catalog:",
"react": "catalog:",
"react-dom": "catalog:",
"react-is": "19.0.0",
@@ -103,7 +102,6 @@
"tailwindcss": "4.0.0"
},
"devDependencies": {
- "prettier-plugin-organize-imports": "3.2.4",
"sharp": "catalog:",
"@types/dom-webcodecs": "catalog:",
"eslint": "catalog:"
diff --git a/packages/example/src/LoopDisplayTest.tsx b/packages/example/src/LoopDisplayTest.tsx
index d99ef12f44..abe91553de 100644
--- a/packages/example/src/LoopDisplayTest.tsx
+++ b/packages/example/src/LoopDisplayTest.tsx
@@ -1,6 +1,6 @@
-import {CalculateMetadataFunction, Composition, Html5Video} from 'remotion';
// https://www.remotion.dev/docs/mediabunny/metadata
import {Video} from '@remotion/media';
+import {CalculateMetadataFunction, Composition, Html5Video} from 'remotion';
import {getMediaMetadata} from './get-media-metadata';
const src = 'https://remotion.media/video-1m.mp4';
diff --git a/packages/example/src/OffthreadRemoteVideo/ChangingTrimBefore.tsx b/packages/example/src/OffthreadRemoteVideo/ChangingTrimBefore.tsx
index dc4693d263..c7f4febfdc 100644
--- a/packages/example/src/OffthreadRemoteVideo/ChangingTrimBefore.tsx
+++ b/packages/example/src/OffthreadRemoteVideo/ChangingTrimBefore.tsx
@@ -1,11 +1,11 @@
import {Audio} from '@remotion/media';
+// https://www.remotion.dev/docs/mediabunny/metadata
+import {useMemo} from 'react';
import {
CalculateMetadataFunction,
Composition,
useCurrentFrame,
} from 'remotion';
-// https://www.remotion.dev/docs/mediabunny/metadata
-import {useMemo} from 'react';
import {getMediaMetadata} from '../get-media-metadata';
const src = 'https://remotion.media/dialogue.wav';
diff --git a/packages/example/src/Root.tsx b/packages/example/src/Root.tsx
index 701e82e7cd..2391c05378 100644
--- a/packages/example/src/Root.tsx
+++ b/packages/example/src/Root.tsx
@@ -1,6 +1,3 @@
-// @ts-expect-error no types
-import styles from './styles.module.scss';
-
import {alias} from 'lib/alias';
import React, {useCallback, useMemo} from 'react';
import {
@@ -82,8 +79,8 @@ import {
} from './StudioApis/SaveDefaultProps';
import {TriggerCalculateMetadata} from './StudioApis/TriggerCalculateMetadata';
import {WriteStaticFile} from './StudioApis/WriteStaticFile';
-import './style.css';
import {SubtitleArtifact} from './SubtitleArtifact/SubtitleArtifact';
+import './style.css';
import {SvgFilter} from './SvgFilter';
import {Tailwind} from './Tailwind';
import {TenFrameTester} from './TenFrameTester';
@@ -105,6 +102,8 @@ import {WarpDemoOuter} from './WarpText';
import {WarpDemo2} from './WarpText/demo2';
import {WatchStaticDemo} from './watch-static';
import {ZodV4SchemaTest, zodV4Schema} from './ZodV4SchemaTest';
+// @ts-expect-error no types
+import styles from './styles.module.scss';
if (alias !== 'alias') {
throw new Error('should support TS aliases');
diff --git a/packages/example/src/ScalePath.tsx b/packages/example/src/ScalePath.tsx
index 6f061e9c8d..c77fb70079 100644
--- a/packages/example/src/ScalePath.tsx
+++ b/packages/example/src/ScalePath.tsx
@@ -1,3 +1,4 @@
+import {getBoundingBox, resetPath, scalePath} from '@remotion/paths';
import opentype from 'opentype.js';
import {useEffect, useRef, useState} from 'react';
import {
@@ -8,8 +9,6 @@ import {
useVideoConfig,
} from 'remotion';
-import {getBoundingBox, resetPath, scalePath} from '@remotion/paths';
-
type FontInfo = {
path: string;
};
diff --git a/packages/example/src/Sfx/index.tsx b/packages/example/src/Sfx/index.tsx
index 67ee3d2905..ab04439539 100644
--- a/packages/example/src/Sfx/index.tsx
+++ b/packages/example/src/Sfx/index.tsx
@@ -5,7 +5,7 @@ import {Audio, Sequence} from 'remotion';
export const SfxExample: React.FC = () => {
return (
<>
- <Sequence from={0} durationInFrames={30}>
+ <Sequence durationInFrames={30}>
<Audio src={whip} />
</Sequence>
<Sequence from={30} durationInFrames={30}>
diff --git a/packages/example/src/ThreeScene/Phone.tsx b/packages/example/src/ThreeScene/Phone.tsx
index a5483be67a..9a4812504b 100644
--- a/packages/example/src/ThreeScene/Phone.tsx
+++ b/packages/example/src/ThreeScene/Phone.tsx
@@ -2,7 +2,6 @@ import {useThree} from '@react-three/fiber';
import React, {useEffect, useMemo} from 'react';
import {interpolate, spring, useCurrentFrame, useVideoConfig} from 'remotion';
import {Texture} from 'three';
-import {RoundedBox} from './RoundedBox';
import {
CAMERA_DISTANCE,
PHONE_CURVE_SEGMENTS,
@@ -10,6 +9,7 @@ import {
getPhoneLayout,
} from './helpers/layout';
import {roundedRect} from './helpers/rounded-rectangle';
+import {RoundedBox} from './RoundedBox';
export const Phone: React.FC<{
readonly videoTexture: Texture | null;
diff --git a/packages/example/src/WarpText/demo2.tsx b/packages/example/src/WarpText/demo2.tsx
index 49589d0d6e..2cda03a7dc 100644
--- a/packages/example/src/WarpText/demo2.tsx
+++ b/packages/example/src/WarpText/demo2.tsx
@@ -1,9 +1,8 @@
+import {getBoundingBox, resetPath, warpPath, WarpPathFn} from '@remotion/paths';
import opentype from 'opentype.js';
import {useEffect, useRef, useState} from 'react';
import {AbsoluteFill, staticFile, useCurrentFrame} from 'remotion';
-import {getBoundingBox, resetPath, warpPath, WarpPathFn} from '@remotion/paths';
-
type FontInfo = {
path: string;
};
diff --git a/packages/example/src/test/stills-and-colorspaces.test.ts b/packages/example/src/test/stills-and-colorspaces.test.ts
index af23b05af0..5a52c6eb81 100644
--- a/packages/example/src/test/stills-and-colorspaces.test.ts
+++ b/packages/example/src/test/stills-and-colorspaces.test.ts
@@ -1,3 +1,8 @@
+import {beforeAll, expect, test} from 'bun:test';
+import {execSync} from 'node:child_process';
+import {existsSync, readFileSync, unlinkSync, writeFileSync} from 'node:fs';
+import {tmpdir} from 'node:os';
+import path from 'node:path';
import {
RenderInternals,
renderMedia,
@@ -6,11 +11,6 @@ import {
StillImageFormat,
} from '@remotion/renderer';
import {$} from 'bun';
-import {beforeAll, expect, test} from 'bun:test';
-import {execSync} from 'node:child_process';
-import {existsSync, readFileSync, unlinkSync, writeFileSync} from 'node:fs';
-import {tmpdir} from 'node:os';
-import path from 'node:path';
import sharp from 'sharp';
if (process.platform === 'win32') {
diff --git a/packages/example/src/webpack-override.mjs b/packages/example/src/webpack-override.mjs
index 12a3b30ea8..ae3089689d 100644
--- a/packages/example/src/webpack-override.mjs
+++ b/packages/example/src/webpack-override.mjs
@@ -1,9 +1,8 @@
+import path from 'node:path';
import {enableScss} from '@remotion/enable-scss';
import {enableSkia} from '@remotion/skia/enable';
import {enableTailwind} from '@remotion/tailwind-v4';
-import path from 'node:path';
-
const WEBPACK_OR_ESBUILD = 'esbuild';
const resolveCwd = (p) => {