Skip to content

πŸŽ₯ Make videos programmatically with React

refactor: simplify video layouts and group timeline tracks

JonnyBurger44f4ecc52840
diff --git a/.agents/skills/remotion-new-markup/SKILL.md b/.agents/skills/remotion-new-markup/SKILL.md
index 5a31fe11ed..5b51a1decf 100644
--- a/.agents/skills/remotion-new-markup/SKILL.md
+++ b/.agents/skills/remotion-new-markup/SKILL.md
@@ -39,6 +39,11 @@ Use `<Track>` for items with their own timing that do not overlap. Use
it automatically places its scenes on the same timeline row. Keep unrelated
content layers on separate rows.
+Give media clips in a `<Track>` explicit `durationInFrames` values based on
+their verified source lengths, trims, and playback rates. Studio can treat an
+unbounded clip as lasting to the end of its parent rather than using the source
+file's duration, causing an overlap error even when the source files do not overlap.
+
## Use a managed full-size layout
Discourage `<AbsoluteFill>` as a scene or component wrapper. It often creates
diff --git a/packages/example/src/Portfolio/Portfolio.tsx b/packages/example/src/Portfolio/Portfolio.tsx
index e29b7c9ad0..3c56979356 100644
--- a/packages/example/src/Portfolio/Portfolio.tsx
+++ b/packages/example/src/Portfolio/Portfolio.tsx
@@ -6,7 +6,7 @@ import {
} from '@remotion/transitions';
import {slide} from '@remotion/transitions/slide';
import React from 'react';
-import {AbsoluteFill} from 'remotion';
+import {AbsoluteFill, Track} from 'remotion';
import {Grain} from './components/Grain';
import {Hud} from './components/Hud';
import {LightLeakOverlay} from './components/LightLeakOverlay';
@@ -27,7 +27,7 @@ import {slabWipe} from './transitions/slab-wipe';
export const Portfolio: React.FC = () => {
return (
<AbsoluteFill style={{backgroundColor: '#0B0B0F'}}>
- <TransitionSeries>
+ <TransitionSeries name="Portfolio scenes">
<TransitionSeries.Sequence
name="Intro"
durationInFrames={150}
@@ -124,36 +124,43 @@ export const Portfolio: React.FC = () => {
src="https://remotion.media/portfolio-reel/v1/music.wav"
volume={0.6}
/>
- <Audio
- name="Whoosh β€” slab wipe"
- src="https://remotion.media/portfolio-reel/v1/sfx/whoosh.wav"
- from={384}
- volume={0.6}
- />
- <Audio
- name="Whoosh β€” circle reveal"
- src="https://remotion.media/portfolio-reel/v1/sfx/whoosh.wav"
- from={564}
- volume={0.5}
- />
- <Audio
- name="Whoosh β€” slide"
- src="https://remotion.media/portfolio-reel/v1/sfx/whoosh.wav"
- from={744}
- volume={0.5}
- />
- <Audio
- name="Whip β€” blinds"
- src="https://remotion.media/portfolio-reel/v1/sfx/whip.wav"
- from={1164}
- volume={0.45}
- />
- <Audio
- name="Whoosh β€” slab wipe 2"
- src="https://remotion.media/portfolio-reel/v1/sfx/whoosh.wav"
- from={1344}
- volume={0.6}
- />
+ <Track name="Transition sounds">
+ <Audio
+ durationInFrames={5}
+ name="Whoosh β€” slab wipe"
+ src="https://remotion.media/portfolio-reel/v1/sfx/whoosh.wav"
+ from={384}
+ volume={0.6}
+ />
+ <Audio
+ durationInFrames={5}
+ name="Whoosh β€” circle reveal"
+ src="https://remotion.media/portfolio-reel/v1/sfx/whoosh.wav"
+ from={564}
+ volume={0.5}
+ />
+ <Audio
+ durationInFrames={5}
+ name="Whoosh β€” slide"
+ src="https://remotion.media/portfolio-reel/v1/sfx/whoosh.wav"
+ from={744}
+ volume={0.5}
+ />
+ <Audio
+ durationInFrames={6}
+ name="Whip β€” blinds"
+ src="https://remotion.media/portfolio-reel/v1/sfx/whip.wav"
+ from={1164}
+ volume={0.45}
+ />
+ <Audio
+ durationInFrames={5}
+ name="Whoosh β€” slab wipe 2"
+ src="https://remotion.media/portfolio-reel/v1/sfx/whoosh.wav"
+ from={1344}
+ volume={0.6}
+ />
+ </Track>
</AbsoluteFill>
);
};
diff --git a/packages/example/src/Portfolio/scenes/Interface.tsx b/packages/example/src/Portfolio/scenes/Interface.tsx
index 29dd1cca0a..558235d21d 100644
--- a/packages/example/src/Portfolio/scenes/Interface.tsx
+++ b/packages/example/src/Portfolio/scenes/Interface.tsx
@@ -3,6 +3,7 @@ import {evolvePath} from '@remotion/paths';
import React from 'react';
import {
AbsoluteFill,
+ Track,
Easing,
Interactive,
interpolate,
@@ -1004,30 +1005,38 @@ export const Interface: React.FC = () => {
color={colors.paper}
start={16}
/>
- <Audio
- name="Toggle click"
- src="https://remotion.media/portfolio-reel/v1/sfx/mouse-click.wav"
- from={TOGGLE_CLICK}
- volume={0.8}
- />
- <Audio
- name="Toggle switch"
- src="https://remotion.media/portfolio-reel/v1/sfx/switch.wav"
- from={TOGGLE_CLICK + 2}
- volume={0.5}
- />
- <Audio
- name="Publish click"
- src="https://remotion.media/portfolio-reel/v1/sfx/mouse-click.wav"
- from={PUBLISH_CLICK}
- volume={0.8}
- />
- <Audio
- name="Toast ding"
- src="https://remotion.media/portfolio-reel/v1/sfx/ding.wav"
- from={148}
- volume={0.22}
- />
+ <Track name="Mouse clicks">
+ <Audio
+ durationInFrames={12}
+ name="Toggle click"
+ src="https://remotion.media/portfolio-reel/v1/sfx/mouse-click.wav"
+ from={TOGGLE_CLICK}
+ volume={0.8}
+ />
+ <Audio
+ durationInFrames={12}
+ name="Publish click"
+ src="https://remotion.media/portfolio-reel/v1/sfx/mouse-click.wav"
+ from={PUBLISH_CLICK}
+ volume={0.8}
+ />
+ </Track>
+ <Track name="Interface feedback">
+ <Audio
+ durationInFrames={10}
+ name="Toggle switch"
+ src="https://remotion.media/portfolio-reel/v1/sfx/switch.wav"
+ from={TOGGLE_CLICK + 2}
+ volume={0.5}
+ />
+ <Audio
+ durationInFrames={42}
+ name="Toast ding"
+ src="https://remotion.media/portfolio-reel/v1/sfx/ding.wav"
+ from={148}
+ volume={0.22}
+ />
+ </Track>
</AbsoluteFill>
);
};
diff --git a/packages/example/src/WhatsNew/Root.tsx b/packages/example/src/WhatsNew/Root.tsx
index 0d3e84046b..0c0d51544e 100644
--- a/packages/example/src/WhatsNew/Root.tsx
+++ b/packages/example/src/WhatsNew/Root.tsx
@@ -17,6 +17,13 @@ export const WhatsNewRoot: React.FC = () => {
return (
<>
<Composition
+ defaultProps={{
+ style: {
+ overflow: 'visible',
+ flexDirection: 'column',
+ backgroundColor: '#000',
+ },
+ }}
id="WhatsNew"
component={WhatsNew}
durationInFrames={7328}
@@ -25,6 +32,13 @@ export const WhatsNewRoot: React.FC = () => {
height={1080}
/>
<Still
+ defaultProps={{
+ style: {
+ overflow: 'hidden',
+ flexDirection: 'column',
+ backgroundColor: '#06080E',
+ },
+ }}
id="WhatsNew-Thumbnail"
component={Thumbnail}
width={1280}
@@ -32,6 +46,7 @@ export const WhatsNewRoot: React.FC = () => {
/>
<Folder name="WhatsNew-Scenes">
<Composition
+ defaultProps={{style: {overflow: 'visible', flexDirection: 'column'}}}
id="WhatsNew-Intro"
component={IntroScene}
durationInFrames={208}
@@ -40,6 +55,7 @@ export const WhatsNewRoot: React.FC = () => {
height={1080}
/>
<Composition
+ defaultProps={{style: {overflow: 'visible', flexDirection: 'column'}}}
id="WhatsNew-LightLeaks"
component={LightLeaksScene}
durationInFrames={720}
@@ -48,6 +64,7 @@ export const WhatsNewRoot: React.FC = () => {
height={1080}
/>
<Composition
+ defaultProps={{style: {overflow: 'visible', flexDirection: 'column'}}}
id="WhatsNew-SoundEffects"
component={SoundEffectsScene}
durationInFrames={1152}
@@ -56,6 +73,7 @@ export const WhatsNewRoot: React.FC = () => {
height={1080}
/>
<Composition
+ defaultProps={{style: {overflow: 'visible', flexDirection: 'column'}}}
id="WhatsNew-Vercel"
component={VercelScene}
durationInFrames={1040}
@@ -64,6 +82,7 @@ export const WhatsNewRoot: React.FC = () => {
height={1080}
/>
<Composition
+ defaultProps={{style: {overflow: 'visible', flexDirection: 'column'}}}
id="WhatsNew-Skills"
component={SkillsScene}
durationInFrames={608}
@@ -72,6 +91,7 @@ export const WhatsNewRoot: React.FC = () => {
height={1080}
/>
<Composition
+ defaultProps={{style: {overflow: 'visible', flexDirection: 'column'}}}
id="WhatsNew-ClientSide"
component={ClientSideScene}
durationInFrames={832}
@@ -80,6 +100,7 @@ export const WhatsNewRoot: React.FC = () => {
height={1080}
/>
<Composition
+ defaultProps={{style: {overflow: 'visible', flexDirection: 'column'}}}
id="WhatsNew-Agents"
component={AgentsScene}
durationInFrames={976}
@@ -88,6 +109,7 @@ export const WhatsNewRoot: React.FC = () => {
height={1080}
/>
<Composition
+ defaultProps={{style: {overflow: 'visible', flexDirection: 'column'}}}
id="WhatsNew-Bundling"
component={BundlingScene}
durationInFrames={720}
@@ -96,6 +118,7 @@ export const WhatsNewRoot: React.FC = () => {
height={1080}
/>
<Composition
+ defaultProps={{style: {overflow: 'visible', flexDirection: 'column'}}}
id="WhatsNew-SneakPeek"
component={SneakPeekScene}
durationInFrames={912}
@@ -104,6 +127,13 @@ export const WhatsNewRoot: React.FC = () => {
height={1080}
/>
<Composition
+ defaultProps={{
+ style: {
+ overflow: 'visible',
+ flexDirection: 'column',
+ backgroundColor: '#000',
+ },
+ }}
id="WhatsNew-Outro"
component={OutroScene}
durationInFrames={160}
diff --git a/packages/example/src/WhatsNew/Thumbnail.tsx b/packages/example/src/WhatsNew/Thumbnail.tsx
index 9388de4d11..03676de43d 100644
--- a/packages/example/src/WhatsNew/Thumbnail.tsx
+++ b/packages/example/src/WhatsNew/Thumbnail.tsx
@@ -1,6 +1,6 @@
import {lightLeak} from '@remotion/effects/light-leak';
import React from 'react';
-import {AbsoluteFill, Img, Solid} from 'remotion';
+import {Interactive, Img, Solid} from 'remotion';
import {
BoltIcon,
EyeIcon,
@@ -20,9 +20,9 @@ const tiles = [
{color: '#2A1F4D', icon: <EyeIcon size={44} color={accents.sneakPeek} />},
];
-export const Thumbnail: React.FC = () => {
+const ThumbnailInner: React.FC = () => {
return (
- <AbsoluteFill style={{backgroundColor: '#06080E', overflow: 'hidden'}}>
+ <>
<Img
src={
'https://remotion.media/announcements/whats-new-in-remotion/cursor/thumbnail/face.jpg'
@@ -43,8 +43,17 @@ export const Thumbnail: React.FC = () => {
style={{position: 'absolute', mixBlendMode: 'screen', opacity: 0.7}}
effects={[lightLeak({seed: 9, hueShift: 0, progress: 0.22})]}
/>
- <AbsoluteFill
+ <div
style={{
+ position: 'absolute',
+ top: 0,
+ left: 0,
+ right: 0,
+ bottom: 0,
+ width: '100%',
+ height: '100%',
+ display: 'flex',
+ flexDirection: 'column',
background:
'linear-gradient(90deg, rgba(6,8,14,0.94) 0%, rgba(6,8,14,0.8) 34%, rgba(6,8,14,0) 60%)',
}}
@@ -110,6 +119,11 @@ export const Thumbnail: React.FC = () => {
))}
</div>
</div>
- </AbsoluteFill>
+ </>
);
};
+
+export const Thumbnail = Interactive.create({
+ Component: ThumbnailInner,
+ layout: 'absolute-fill',
+});
diff --git a/packages/example/src/WhatsNew/WhatsNew.tsx b/packages/example/src/WhatsNew/WhatsNew.tsx
index 8641593405..d0fceb5468 100644
--- a/packages/example/src/WhatsNew/WhatsNew.tsx
+++ b/packages/example/src/WhatsNew/WhatsNew.tsx
@@ -1,7 +1,7 @@
import {Audio} from '@remotion/media';
import {TransitionSeries} from '@remotion/transitions';
import React from 'react';
-import {AbsoluteFill, interpolate, useCurrentFrame} from 'remotion';
+import {Interactive, interpolate, useCurrentFrame} from 'remotion';
import {LightLeakFx} from './components/LightLeakFx';
import {AgentsScene} from './scenes/Agents';
import {BundlingScene} from './scenes/Bundling';
@@ -16,18 +16,18 @@ import {VercelScene} from './scenes/Vercel';
// Every scene is a whole number of beats (16 frames at 112.5 BPM), so each
// chapter starts on a downbeat of the score.
-export const WhatsNew: React.FC = () => {
+const WhatsNewInner: React.FC = () => {
const frame = useCurrentFrame();
return (
- <AbsoluteFill style={{backgroundColor: '#000'}}>
+ <>
<TransitionSeries name="Chapters">
<TransitionSeries.Sequence
name="Intro"
durationInFrames={208}
premountFor={60}
>
- <IntroScene />
+ <IntroScene style={{overflow: 'visible', flexDirection: 'column'}} />
</TransitionSeries.Sequence>
<TransitionSeries.Overlay durationInFrames={32}>
<LightLeakFx seed={1} hueShift={0} />
@@ -37,7 +37,9 @@ export const WhatsNew: React.FC = () => {
durationInFrames={720}
premountFor={60}
>
- <LightLeaksScene />
+ <LightLeaksScene
+ style={{overflow: 'visible', flexDirection: 'column'}}
+ />
</TransitionSeries.Sequence>
<TransitionSeries.Overlay durationInFrames={32}>
<LightLeakFx seed={4} hueShift={135} />
@@ -47,7 +49,9 @@ export const WhatsNew: React.FC = () => {
durationInFrames={1152}
premountFor={60}
>
- <SoundEffectsScene />
+ <SoundEffectsScene
+ style={{overflow: 'visible', flexDirection: 'column'}}
+ />
</TransitionSeries.Sequence>
<TransitionSeries.Overlay durationInFrames={32}>
<LightLeakFx seed={7} hueShift={20} />
@@ -57,7 +61,7 @@ export const WhatsNew: React.FC = () => {
durationInFrames={1040}
premountFor={60}
>
- <VercelScene />
+ <VercelScene style={{overflow: 'visible', flexDirection: 'column'}} />
</TransitionSeries.Sequence>
<TransitionSeries.Overlay durationInFrames={32}>
<LightLeakFx seed={10} hueShift={245} />
@@ -67,7 +71,7 @@ export const WhatsNew: React.FC = () => {
durationInFrames={608}
premountFor={60}
>
- <SkillsScene />
+ <SkillsScene style={{overflow: 'visible', flexDirection: 'column'}} />
</TransitionSeries.Sequence>
<TransitionSeries.Overlay durationInFrames={32}>
<LightLeakFx seed={13} hueShift={185} />
@@ -77,7 +81,9 @@ export const WhatsNew: React.FC = () => {
durationInFrames={832}
premountFor={60}
>
- <ClientSideScene />
+ <ClientSideScene
+ style={{overflow: 'visible', flexDirection: 'column'}}
+ />
</TransitionSeries.Sequence>
<TransitionSeries.Overlay durationInFrames={32}>
<LightLeakFx seed={16} hueShift={45} />
@@ -87,7 +93,7 @@ export const WhatsNew: React.FC = () => {
durationInFrames={976}
premountFor={60}
>
- <AgentsScene />
+ <AgentsScene style={{overflow: 'visible', flexDirection: 'column'}} />
</TransitionSeries.Sequence>
<TransitionSeries.Overlay durationInFrames={32}>
<LightLeakFx seed={19} hueShift={345} />
@@ -97,7 +103,9 @@ export const WhatsNew: React.FC = () => {
durationInFrames={720}
premountFor={60}
>
- <BundlingScene />
+ <BundlingScene
+ style={{overflow: 'visible', flexDirection: 'column'}}
+ />
</TransitionSeries.Sequence>
<TransitionSeries.Overlay durationInFrames={32}>
<LightLeakFx seed={22} hueShift={120} />
@@ -107,13 +115,21 @@ export const WhatsNew: React.FC = () => {
durationInFrames={912}
premountFor={60}
>
- <SneakPeekScene />
+ <SneakPeekScene
+ style={{overflow: 'visible', flexDirection: 'column'}}
+ />
</TransitionSeries.Sequence>
<TransitionSeries.Overlay durationInFrames={32}>
<LightLeakFx seed={25} hueShift={180} />
</TransitionSeries.Overlay>
<TransitionSeries.Sequence name="Outro" durationInFrames={160}>
- <OutroScene />
+ <OutroScene
+ style={{
+ overflow: 'visible',
+ flexDirection: 'column',
+ backgroundColor: '#000',
+ }}
+ />
</TransitionSeries.Sequence>
</TransitionSeries>
@@ -129,6 +145,11 @@ export const WhatsNew: React.FC = () => {
{extrapolateLeft: 'clamp', extrapolateRight: 'clamp'},
)}
/>
- </AbsoluteFill>
+ </>
);
};
+
+export const WhatsNew = Interactive.create({
+ Component: WhatsNewInner,
+ layout: 'absolute-fill',
+});
diff --git a/packages/example/src/WhatsNew/components/Background.tsx b/packages/example/src/WhatsNew/components/Background.tsx
index 3a1f8f7bba..a198b64989 100644
--- a/packages/example/src/WhatsNew/components/Background.tsx
+++ b/packages/example/src/WhatsNew/components/Background.tsx
@@ -1,21 +1,37 @@
import React from 'react';
-import {AbsoluteFill, useCurrentFrame} from 'remotion';
+import {
+ Interactive,
+ type InteractiveTransformProps,
+ useCurrentFrame,
+} from 'remotion';
import {colors} from '../theme';
// Soft brand backdrop that is visible whenever the talking head is not full
// frame. Two slow color fields drift over a dot grid.
-export const Backdrop: React.FC<{
- readonly accent: string;
- readonly dark?: boolean;
-}> = ({accent, dark = false}) => {
+const BackdropInner: React.FC<
+ {
+ readonly accent: string;
+ readonly dark?: boolean;
+ } & InteractiveTransformProps
+> = ({accent, dark = false, style}) => {
const frame = useCurrentFrame();
const t = frame / 30;
return (
- <AbsoluteFill
+ <div
style={{
+ position: 'absolute',
+ top: 0,
+ left: 0,
+ right: 0,
+ bottom: 0,
+ width: '100%',
+ height: '100%',
+ display: 'flex',
+ flexDirection: 'column',
backgroundColor: dark ? '#06080E' : colors.mist,
overflow: 'hidden',
+ ...style,
}}
>
<div
@@ -40,13 +56,27 @@ export const Backdrop: React.FC<{
background: `radial-gradient(circle, ${colors.blue}${dark ? '40' : '2e'} 0%, ${colors.blue}00 60%)`,
}}
/>
- <AbsoluteFill
+ <div
style={{
+ position: 'absolute',
+ top: 0,
+ left: 0,
+ right: 0,
+ bottom: 0,
+ width: '100%',
+ height: '100%',
+ display: 'flex',
+ flexDirection: 'column',
backgroundImage: `radial-gradient(${dark ? 'rgba(255,255,255,0.10)' : 'rgba(11,15,25,0.10)'} 1.7px, transparent 1.8px)`,
backgroundSize: '38px 38px',
backgroundPosition: `${(frame * 0.35) % 38}px ${(frame * 0.2) % 38}px`,
}}
/>
- </AbsoluteFill>
+ </div>
);
};
+
+export const Backdrop = Interactive.create({
+ Component: BackdropInner,
+ layout: 'none',
+});
diff --git a/packages/example/src/WhatsNew/components/Stage.tsx b/packages/example/src/WhatsNew/components/Stage.tsx
index 9e64987b1c..395ab7966d 100644
--- a/packages/example/src/WhatsNew/components/Stage.tsx
+++ b/packages/example/src/WhatsNew/components/Stage.tsx
@@ -1,5 +1,10 @@
import React from 'react';
-import {AbsoluteFill, interpolate, useCurrentFrame} from 'remotion';
+import {
+ Interactive,
+ type InteractiveTransformProps,
+ interpolate,
+ useCurrentFrame,
+} from 'remotion';
import {easeInOut, lerp} from '../anim';
import {FACE} from '../theme';
@@ -113,7 +118,7 @@ export const getCaptionPlacement = (
};
};
-export const Stage: React.FC<{
+const StageInner: React.FC<{
readonly keyframes: readonly LayoutKeyframe[];
readonly children: React.ReactNode;
}> = ({keyframes, children}) => {
@@ -121,7 +126,7 @@ export const Stage: React.FC<{
const l = getLayout(frame, keyframes);
return (
- <AbsoluteFill>
+ <>
<div
style={{
position: 'absolute',
@@ -148,39 +153,78 @@ export const Stage: React.FC<{
}}
>
{children}
- <AbsoluteFill
+ <div
style={{
+ position: 'absolute',
+ top: 0,
+ left: 0,
+ right: 0,
+ bottom: 0,
+ width: '100%',
+ height: '100%',
+ display: 'flex',
+ flexDirection: 'column',
background:
'radial-gradient(ellipse 75% 80% at 52% 42%, rgba(0,0,0,0) 55%, rgba(8,12,24,0.34) 100%)',
}}
/>
</div>
- <AbsoluteFill
+ <div
style={{
+ position: 'absolute',
+ top: 0,
+ left: 0,
+ right: 0,
+ bottom: 0,
+ width: '100%',
+ height: '100%',
+ display: 'flex',
+ flexDirection: 'column',
borderRadius: l.r,
boxShadow: `inset 0 0 0 ${7 * l.card}px rgba(255,255,255,0.96)`,
}}
/>
</div>
- </AbsoluteFill>
+ </>
);
};
// Punch-in framing for a single shot. Every cut switches framing, which hides
// the jump and gives the talking head rhythm. A slow drift keeps it alive.
-export const Punch: React.FC<{
- readonly zoom?: number;
- readonly children: React.ReactNode;
-}> = ({zoom = 1, children}) => {
+const PunchInner: React.FC<
+ {
+ readonly zoom?: number;
+ readonly children: React.ReactNode;
+ } & InteractiveTransformProps
+> = ({zoom = 1, children, style}) => {
const frame = useCurrentFrame();
return (
- <AbsoluteFill
+ <div
style={{
+ position: 'absolute',
+ top: 0,
+ left: 0,
+ right: 0,
+ bottom: 0,
+ width: '100%',
+ height: '100%',
+ display: 'flex',
+ flexDirection: 'column',
scale: zoom * (1 + frame * 0.00012),
transformOrigin: `${FACE.x}px ${FACE.y}px`,
+ ...style,
}}
>
{children}
- </AbsoluteFill>
+ </div>
);
};
+
+export const Stage = Interactive.create({
+ Component: StageInner,
+ layout: 'absolute-fill',
+});
+export const Punch = Interactive.create({
+ Component: PunchInner,
+ layout: 'none',
+});
diff --git a/packages/example/src/WhatsNew/components/fx.tsx b/packages/example/src/WhatsNew/components/fx.tsx
index a86a22d302..8bc5e84dbd 100644
--- a/packages/example/src/WhatsNew/components/fx.tsx
+++ b/packages/example/src/WhatsNew/components/fx.tsx
@@ -1,6 +1,7 @@
import React from 'react';
import {
- AbsoluteFill,
+ Interactive,
+ type InteractiveTransformProps,
interpolate,
random,
useCurrentFrame,
@@ -9,11 +10,13 @@ import {
import {easeOut} from '../anim';
// Radial speed streaks around a focus point.
-export const SpeedLines: React.FC<{
- readonly color?: string;
- readonly cx?: number;
- readonly cy?: number;
-}> = ({color = 'rgba(255,255,255,0.85)', cx = 1000, cy = 430}) => {
+const SpeedLinesInner: React.FC<
+ {
+ readonly color?: string;
+ readonly cx?: number;
+ readonly cy?: number;
+ } & InteractiveTransformProps
+> = ({color = 'rgba(255,255,255,0.85)', cx = 1000, cy = 430, style}) => {
const frame = useCurrentFrame();
const {durationInFrames} = useVideoConfig();
const fade = interpolate(
@@ -23,7 +26,21 @@ export const SpeedLines: React.FC<{
{extrapolateLeft: 'clamp', extrapolateRight: 'clamp'},
);
return (
- <AbsoluteFill style={{opacity: fade}}>
+ <div
+ style={{
+ position: 'absolute',
+ top: 0,
+ left: 0,
+ right: 0,
+ bottom: 0,
+ width: '100%',
+ height: '100%',
+ display: 'flex',
+ flexDirection: 'column',
+ opacity: fade,
+ ...style,
+ }}
+ >
<svg width={1920} height={1080}>
{new Array(46).fill(true).map((_, i) => {
const angle = random(`angle-${i}`) * Math.PI * 2;
@@ -50,14 +67,14 @@ export const SpeedLines: React.FC<{
);
})}
</svg>
- </AbsoluteFill>
+ </div>
);
};
// Cinematic bars that slide in from top and bottom.
-export const Letterbox: React.FC<{readonly height?: number}> = ({
- height = 104,
-}) => {
+const LetterboxInner: React.FC<
+ {readonly height?: number} & InteractiveTransformProps
+> = ({height = 104, style}) => {
const frame = useCurrentFrame();
const {durationInFrames} = useVideoConfig();
const p = interpolate(
@@ -71,7 +88,20 @@ export const Letterbox: React.FC<{readonly height?: number}> = ({
},
);
return (
- <AbsoluteFill>
+ <div
+ style={{
+ position: 'absolute',
+ top: 0,
+ left: 0,
+ right: 0,
+ bottom: 0,
+ width: '100%',
+ height: '100%',
+ display: 'flex',
+ flexDirection: 'column',
+ ...style,
+ }}
+ >
<div
style={{
position: 'absolute',
@@ -92,12 +122,12 @@ export const Letterbox: React.FC<{readonly height?: number}> = ({
backgroundColor: '#000',
}}
/>
- </AbsoluteFill>
+ </div>
);
};
// A one-shot burst of confetti dots from a point.
-export const Burst: React.FC<{
+const BurstInner: React.FC<{
readonly x: number;
readonly y: number;
readonly colors: readonly string[];
@@ -105,7 +135,7 @@ export const Burst: React.FC<{
}> = ({x, y, colors, count = 28}) => {
const frame = useCurrentFrame();
return (
- <AbsoluteFill>
+ <>
{new Array(count).fill(true).map((_, i) => {
const angle = random(`b-a-${i}`) * Math.PI * 2;
const distance = 140 + random(`b-d-${i}`) * 260;
@@ -136,7 +166,7 @@ export const Burst: React.FC<{
/>
);
})}
- </AbsoluteFill>
+ </>
);
};
@@ -180,3 +210,16 @@ export const WaveBars: React.FC<{
</div>
);
};
+
+export const SpeedLines = Interactive.create({
+ Component: SpeedLinesInner,
+ layout: 'none',
+});
+export const Letterbox = Interactive.create({
+ Component: LetterboxInner,
+ layout: 'none',
+});
+export const Burst = Interactive.create({
+ Component: BurstInner,
+ layout: 'absolute-fill',
+});
diff --git a/packages/example/src/WhatsNew/scenes/Agents.tsx b/packages/example/src/WhatsNew/scenes/Agents.tsx
index 12848d5040..35cc493618 100644
--- a/packages/example/src/WhatsNew/scenes/Agents.tsx
+++ b/packages/example/src/WhatsNew/scenes/Agents.tsx
@@ -1,7 +1,8 @@
import {Audio, Video} from '@remotion/media';
import React from 'react';
import {
- AbsoluteFill,
+ Track,
+ Interactive,
interpolate,
Sequence,
Series,
@@ -339,18 +340,18 @@ const Zod4: React.FC = () => {
</Stamp>
</div>
{frame >= 124 ? (
- <Sequence from={124} layout="none">
- <Burst
- x={250}
- y={260}
- colors={[
- colors.blue,
- accents.agents,
- accents.bundling,
- colors.success,
- ]}
- />
- </Sequence>
+ <Burst
+ from={124}
+ style={{overflow: 'visible', flexDirection: 'column'}}
+ x={250}
+ y={260}
+ colors={[
+ colors.blue,
+ accents.agents,
+ accents.bundling,
+ colors.success,
+ ]}
+ />
) : null}
</Panel>
);
@@ -413,14 +414,17 @@ const LetUsKnow: React.FC = () => (
</div>
);
-export const AgentsScene: React.FC = () => {
+const AgentsSceneInner: React.FC = () => {
const frame = useCurrentFrame();
const captions = getCaptionPlacement(frame, layout);
return (
- <AbsoluteFill>
+ <>
<Backdrop accent={accents.agents} />
- <Stage keyframes={layout}>
+ <Stage
+ style={{overflow: 'visible', flexDirection: 'column'}}
+ keyframes={layout}
+ >
<Series>
<Series.Sequence
name="Better with agents"
@@ -1147,66 +1151,85 @@ export const AgentsScene: React.FC = () => {
]}
/>
- <Audio
- name="Sticker whoosh"
- src="https://remotion.media/whoosh.wav"
- from={1}
- volume={0.3}
- />
- <Audio
- name="Split whip"
- src="https://remotion.media/whip.wav"
- from={92}
- volume={0.16}
- />
- <Audio
- name="Rough edges"
- src="https://remotion.media/windows-xp-error.wav"
- from={272}
- volume={0.16}
- />
- <Audio
- name="Fixed"
- src="https://remotion.media/ding.wav"
- from={362}
- volume={0.2}
- />
- <Audio
- name="Studio running"
- src="https://remotion.media/mouse-click.wav"
- from={408}
- volume={0.3}
- />
- <Audio
- name="Prevented"
- src="https://remotion.media/switch.wav"
- from={562}
- volume={0.24}
- />
- <Audio
- name="Error gone"
- src="https://remotion.media/whoosh.wav"
- from={720}
- volume={0.32}
- />
- <Audio
- name="Finally stamp"
- src="https://remotion.media/shutter-modern.wav"
- from={826}
- volume={0.22}
- />
- <Audio
- name="Zod 4"
- src="https://remotion.media/yippee.wav"
- from={874}
- volume={0.14}
- />
- <Audio
- name="Let us know"
- src="https://remotion.media/mouse-click.wav"
- from={906}
- volume={0.3}
- />
- </AbsoluteFill>
+ <Track name="Sound effects">
+ <Audio
+ durationInFrames={5}
+ name="Sticker whoosh"
+ src="https://remotion.media/whoosh.wav"
+ from={1}
+ volume={0.3}
+ />
+ <Audio
+ durationInFrames={6}
+ name="Split whip"
+ src="https://remotion.media/whip.wav"
+ from={92}
+ volume={0.16}
+ />
+ <Audio
+ durationInFrames={30}
+ name="Rough edges"
+ src="https://remotion.media/windows-xp-error.wav"
+ from={272}
+ volume={0.16}
+ />
+ <Audio
+ durationInFrames={42}
+ name="Fixed"
+ src="https://remotion.media/ding.wav"
+ from={362}
+ volume={0.2}
+ />
+ <Audio
+ durationInFrames={12}
+ name="Studio running"
+ src="https://remotion.media/mouse-click.wav"
+ from={408}
+ volume={0.3}
+ />
+ <Audio
+ durationInFrames={10}
+ name="Prevented"
+ src="https://remotion.media/switch.wav"
+ from={562}
+ volume={0.24}
+ />
+ <Audio
+ durationInFrames={5}
+ name="Error gone"
+ src="https://remotion.media/whoosh.wav"
+ from={720}
+ volume={0.32}
+ />
+ <Audio
+ durationInFrames={15}
+ name="Finally stamp"
+ src="https://remotion.media/shutter-modern.wav"
+ from={826}
+ volume={0.22}
+ />
+ <Audio
+ durationInFrames={80}
+ name="Zod 4"
+ src="https://remotion.media/yippee.wav"
+ from={874}
+ volume={0.14}
+ />
+ </Track>
+ <Track name="Overlapping sound effects">
+ <Audio
+ durationInFrames={12}
+ name="Let us know"
+ src="https://remotion.media/mouse-click.wav"
+ from={906}
+ volume={0.3}
+ />
+ </Track>
+ </>
);
};
+
+export const AgentsScene = Interactive.create({
+ Component: AgentsSceneInner,
+ layout: 'absolute-fill',
+});
diff --git a/packages/example/src/WhatsNew/scenes/Bundling.tsx b/packages/example/src/WhatsNew/scenes/Bundling.tsx
index 09590b7cfe..ef976dadb4 100644
--- a/packages/example/src/WhatsNew/scenes/Bundling.tsx
+++ b/packages/example/src/WhatsNew/scenes/Bundling.tsx
@@ -1,7 +1,8 @@
import {Audio, Video} from '@remotion/media';
import React from 'react';
import {
- AbsoluteFill,
+ Track,
+ Interactive,
interpolate,
interpolateColors,
Sequence,
@@ -87,11 +88,11 @@ const RspackConfig: React.FC = () => (
</Panel>
);
-const FasterSlam: React.FC = () => {
+const FasterSlamInner: React.FC = () => {
const frame = useCurrentFrame();
const p = pop(frame, 12, 8);
return (
- <AbsoluteFill>
+ <>
<SpeedLines color="rgba(255,196,0,0.9)" />
<div
style={{
@@ -124,7 +125,7 @@ const FasterSlam: React.FC = () => {
Faster
</div>
</div>
- </AbsoluteFill>
+ </>
);
};
@@ -412,14 +413,17 @@ const Roadmap: React.FC = () => {
);
};
-export const BundlingScene: React.FC = () => {
+const BundlingSceneInner: React.FC = () => {
const frame = useCurrentFrame();
const captions = getCaptionPlacement(frame, layout);
return (
- <AbsoluteFill>
+ <>
<Backdrop accent={accents.bundling} />
- <Stage keyframes={layout}>
+ <Stage
+ style={{overflow: 'visible', flexDirection: 'column'}}
+ keyframes={layout}
+ >
<Series>
<Series.Sequence
name="Faster bundling"
@@ -519,9 +523,12 @@ export const BundlingScene: React.FC = () => {
<Sequence name="Rspack config" from={48} durationInFrames={152}>
<RspackConfig />
</Sequence>
- <Sequence name="Faster slam" from={200} durationInFrames={43}>
- <FasterSlam />
- </Sequence>
+ <FasterSlam
+ name="Faster slam"
+ from={200}
+ durationInFrames={43}
+ style={{overflow: 'visible', flexDirection: 'column'}}
+ />
<Sequence name="Race" from={245} durationInFrames={139}>
<Race />
</Sequence>
@@ -1002,54 +1009,73 @@ export const BundlingScene: React.FC = () => {
]}
/>
- <Audio
- name="Sticker whoosh"
- src="https://remotion.media/whoosh.wav"
- from={0}
- volume={0.3}
- />
- <Audio
- name="Split whip"
- src="https://remotion.media/whip.wav"
- from={40}
- volume={0.16}
- />
- <Audio
- name="Faster whip"
- src="https://remotion.media/whip.wav"
- from={210}
- volume={0.4}
- />
- <Audio
- name="Race whoosh"
- src="https://remotion.media/whoosh.wav"
- from={258}
- volume={0.24}
- />
- <Audio
- name="Twice ding"
- src="https://remotion.media/ding.wav"
- from={345}
- volume={0.22}
- />
- <Audio
- name="Canvas switch"
- src="https://remotion.media/switch.wav"
- from={472}
- volume={0.26}
- />
- <Audio
- name="Today click"
- src="https://remotion.media/mouse-click.wav"
- from={584}
- volume={0.3}
- />
- <Audio
- name="Default click"
- src="https://remotion.media/mouse-click.wav"
- from={624}
- volume={0.3}
- />
- </AbsoluteFill>
+ <Track name="Sound effects">
+ <Audio
+ durationInFrames={5}
+ name="Sticker whoosh"
+ src="https://remotion.media/whoosh.wav"
+ from={0}
+ volume={0.3}
+ />
+ <Audio
+ durationInFrames={6}
+ name="Split whip"
+ src="https://remotion.media/whip.wav"
+ from={40}
+ volume={0.16}
+ />
+ <Audio
+ durationInFrames={6}
+ name="Faster whip"
+ src="https://remotion.media/whip.wav"
+ from={210}
+ volume={0.4}
+ />
+ <Audio
+ durationInFrames={5}
+ name="Race whoosh"
+ src="https://remotion.media/whoosh.wav"
+ from={258}
+ volume={0.24}
+ />
+ <Audio
+ durationInFrames={42}
+ name="Twice ding"
+ src="https://remotion.media/ding.wav"
+ from={345}
+ volume={0.22}
+ />
+ <Audio
+ durationInFrames={10}
+ name="Canvas switch"
+ src="https://remotion.media/switch.wav"
+ from={472}
+ volume={0.26}
+ />
+ <Audio
+ durationInFrames={12}
+ name="Today click"
+ src="https://remotion.media/mouse-click.wav"
+ from={584}
+ volume={0.3}
+ />
+ <Audio
+ durationInFrames={12}
+ name="Default click"
+ src="https://remotion.media/mouse-click.wav"
+ from={624}
+ volume={0.3}
+ />
+ </Track>
+ </>
);
};
+
+const FasterSlam = Interactive.create({
+ Component: FasterSlamInner,
+ layout: 'absolute-fill',
+});
+export const BundlingScene = Interactive.create({
+ Component: BundlingSceneInner,
+ layout: 'absolute-fill',
+});
diff --git a/packages/example/src/WhatsNew/scenes/ClientSide.tsx b/packages/example/src/WhatsNew/scenes/ClientSide.tsx
index 1b1cec07ab..da4ce60588 100644
--- a/packages/example/src/WhatsNew/scenes/ClientSide.tsx
+++ b/packages/example/src/WhatsNew/scenes/ClientSide.tsx
@@ -1,7 +1,8 @@
import {Audio, Video} from '@remotion/media';
import React from 'react';
import {
- AbsoluteFill,
+ Track,
+ Interactive,
interpolate,
Sequence,
Series,
@@ -509,14 +510,17 @@ const CssProperties: React.FC = () => {
);
};
-export const ClientSideScene: React.FC = () => {
+const ClientSideSceneInner: React.FC = () => {
const frame = useCurrentFrame();
const captions = getCaptionPlacement(frame, layout);
return (
- <AbsoluteFill>
+ <>
<Backdrop accent={accents.clientSide} />
- <Stage keyframes={layout}>
+ <Stage
+ style={{overflow: 'visible', flexDirection: 'column'}}
+ keyframes={layout}
+ >
<Series>
<Series.Sequence
name="Client-side rendering"
@@ -1082,54 +1086,69 @@ export const ClientSideScene: React.FC = () => {
]}
/>
- <Audio
- name="Sticker whoosh"
- src="https://remotion.media/whoosh.wav"
- from={1}
- volume={0.3}
- />
- <Audio
- name="Split whip"
- src="https://remotion.media/whip.wav"
- from={96}
- volume={0.16}
- />
- <Audio
- name="Rendered ding"
- src="https://remotion.media/ding.wav"
- from={294}
- volume={0.2}
- />
- <Audio
- name="Queue click"
- src="https://remotion.media/mouse-click.wav"
- from={341}
- volume={0.3}
- />
- <Audio
- name="Formats switch"
- src="https://remotion.media/switch.wav"
- from={549}
- volume={0.22}
- />
- <Audio
- name="Audio formats switch"
- src="https://remotion.media/switch.wav"
- from={627}
- volume={0.22}
- />
- <Audio
- name="CSS whoosh"
- src="https://remotion.media/whoosh.wav"
- from={688}
- volume={0.28}
- />
- <Audio
- name="Supported ding"
- src="https://remotion.media/ding.wav"
- from={802}
- volume={0.2}
- />
- </AbsoluteFill>
+ <Track name="Sound effects">
+ <Audio
+ durationInFrames={5}
+ name="Sticker whoosh"
+ src="https://remotion.media/whoosh.wav"
+ from={1}
+ volume={0.3}
+ />
+ <Audio
+ durationInFrames={6}
+ name="Split whip"
+ src="https://remotion.media/whip.wav"
+ from={96}
+ volume={0.16}
+ />
+ <Audio
+ durationInFrames={42}
+ name="Rendered ding"
+ src="https://remotion.media/ding.wav"
+ from={294}
+ volume={0.2}
+ />
+ <Audio
+ durationInFrames={12}
+ name="Queue click"
+ src="https://remotion.media/mouse-click.wav"
+ from={341}
+ volume={0.3}
+ />
+ <Audio
+ durationInFrames={10}
+ name="Formats switch"
+ src="https://remotion.media/switch.wav"
+ from={549}
+ volume={0.22}
+ />
+ <Audio
+ durationInFrames={10}
+ name="Audio formats switch"
+ src="https://remotion.media/switch.wav"
+ from={627}
+ volume={0.22}
+ />
+ <Audio
+ durationInFrames={5}
+ name="CSS whoosh"
+ src="https://remotion.media/whoosh.wav"
+ from={688}
+ volume={0.28}
+ />
+ <Audio
+ durationInFrames={42}
+ name="Supported ding"
+ src="https://remotion.media/ding.wav"
+ from={802}
+ volume={0.2}
+ />
+ </Track>
+ </>
);
};
+
+export const ClientSideScene = Interactive.create({
+ Component: ClientSideSceneInner,
+ layout: 'absolute-fill',
+});
diff --git a/packages/example/src/WhatsNew/scenes/Intro.tsx b/packages/example/src/WhatsNew/scenes/Intro.tsx
index f7a56774e6..bd00b0c9b6 100644
--- a/packages/example/src/WhatsNew/scenes/Intro.tsx
+++ b/packages/example/src/WhatsNew/scenes/Intro.tsx
@@ -1,7 +1,8 @@
import {Audio, Video} from '@remotion/media';
import React from 'react';
import {
- AbsoluteFill,
+ Track,
+ Interactive,
Easing,
interpolate,
Sequence,
@@ -159,7 +160,7 @@ const GRID_LEFT = (1920 - (TILE_W * 4 + GAP * 3)) / 2;
const GRID_TOP = 356;
// Eight topics slam in on eighth notes, then the board zooms into the first.
-const TopicBoard: React.FC = () => {
+const TopicBoardInner: React.FC = () => {
const frame = useCurrentFrame();
const zoom = interpolate(frame, [70, 96], [0, 1], {
extrapolateLeft: 'clamp',
@@ -171,10 +172,19 @@ const TopicBoard: React.FC = () => {
const header = rise(frame, 0, 12);
return (
- <AbsoluteFill>
+ <>
<Backdrop accent={accents.sneakPeek} dark />
- <AbsoluteFill
+ <div
style={{
+ position: 'absolute',
+ top: 0,
+ left: 0,
+ right: 0,
+ bottom: 0,
+ width: '100%',
+ height: '100%',
+ display: 'flex',
+ flexDirection: 'column',
transformOrigin: `${firstCenterX}px ${firstCenterY}px`,
scale: 1 + zoom * 5.2,
translate: `${(960 - firstCenterX) * zoom}px ${(540 - firstCenterY) * zoom}px`,
@@ -257,18 +267,21 @@ const TopicBoard: React.FC = () => {
</div>
);
})}
- </AbsoluteFill>
- </AbsoluteFill>
+ </div>
+ </>
);
};
-export const IntroScene: React.FC = () => {
+const IntroSceneInner: React.FC = () => {
const frame = useCurrentFrame();
const captions = getCaptionPlacement(frame, layout);
return (
- <AbsoluteFill>
- <Stage keyframes={layout}>
+ <>
+ <Stage
+ style={{overflow: 'visible', flexDirection: 'column'}}
+ keyframes={layout}
+ >
<Series>
<Series.Sequence
name="Opening line"
@@ -387,70 +400,96 @@ export const IntroScene: React.FC = () => {
]}
/>
- <Sequence name="Topic board" from={112} durationInFrames={96}>
- <TopicBoard />
- </Sequence>
-
- <Audio
- name="Title whoosh"
- src="https://remotion.media/whoosh.wav"
- from={0}
- volume={0.3}
- />
- <Audio
- name="Tile 1"
- src="https://remotion.media/switch.wav"
- from={116}
- volume={0.2}
- />
- <Audio
- name="Tile 2"
- src="https://remotion.media/switch.wav"
- from={124}
- volume={0.2}
- />
- <Audio
- name="Tile 3"
- src="https://remotion.media/switch.wav"
- from={132}
- volume={0.2}
- />
- <Audio
- name="Tile 4"
- src="https://remotion.media/switch.wav"
- from={140}
- volume={0.2}
+ <TopicBoard
+ name="Topic board"
+ from={112}
+ durationInFrames={96}
+ style={{overflow: 'visible', flexDirection: 'column'}}
/>
- <Audio
- name="Tile 5"
- src="https://remotion.media/switch.wav"
- from={148}
- volume={0.2}
- />
- <Audio
- name="Tile 6"
- src="https://remotion.media/switch.wav"
- from={156}
- volume={0.2}
- />
- <Audio
- name="Tile 7"
- src="https://remotion.media/switch.wav"
- from={164}
- volume={0.2}
- />
- <Audio
- name="Tile 8"
- src="https://remotion.media/switch.wav"
- from={172}
- volume={0.2}
- />
- <Audio
- name="Zoom whoosh"
- src="https://remotion.media/whoosh.wav"
- from={180}
- volume={0.34}
- />
- </AbsoluteFill>
+
+ <Track name="Sound effects">
+ <Audio
+ durationInFrames={5}
+ name="Title whoosh"
+ src="https://remotion.media/whoosh.wav"
+ from={0}
+ volume={0.3}
+ />
+ <Audio
+ durationInFrames={10}
+ name="Tile 1"
+ src="https://remotion.media/switch.wav"
+ from={116}
+ volume={0.2}
+ />
+ <Audio
+ durationInFrames={10}
+ name="Tile 3"
+ src="https://remotion.media/switch.wav"
+ from={132}
+ volume={0.2}
+ />
+ <Audio
+ durationInFrames={10}
+ name="Tile 5"
+ src="https://remotion.media/switch.wav"
+ from={148}
+ volume={0.2}
+ />
+ <Audio
+ durationInFrames={10}
+ name="Tile 7"
+ src="https://remotion.media/switch.wav"
+ from={164}
+ volume={0.2}
+ />
+ <Audio
+ durationInFrames={5}
+ name="Zoom whoosh"
+ src="https://remotion.media/whoosh.wav"
+ from={180}
+ volume={0.34}
+ />
+ </Track>
+ <Track name="Overlapping sound effects">
+ <Audio
+ durationInFrames={10}
+ name="Tile 2"
+ src="https://remotion.media/switch.wav"
+ from={124}
+ volume={0.2}
+ />
+ <Audio
+ durationInFrames={10}
+ name="Tile 4"
+ src="https://remotion.media/switch.wav"
+ from={140}
+ volume={0.2}
+ />
+ <Audio
+ durationInFrames={10}
+ name="Tile 6"
+ src="https://remotion.media/switch.wav"
+ from={156}
+ volume={0.2}
+ />
+ <Audio
+ durationInFrames={10}
+ name="Tile 8"
+ src="https://remotion.media/switch.wav"
+ from={172}
+ volume={0.2}
+ />
+ </Track>
+ </>
);
};
+
+const TopicBoard = Interactive.create({
+ Component: TopicBoardInner,
+ layout: 'absolute-fill',
+});
+export const IntroScene = Interactive.create({
+ Component: IntroSceneInner,
+ layout: 'absolute-fill',
+});
diff --git a/packages/example/src/WhatsNew/scenes/LightLeaks.tsx b/packages/example/src/WhatsNew/scenes/LightLeaks.tsx
index cb58cd30ff..2ee7b62492 100644
--- a/packages/example/src/WhatsNew/scenes/LightLeaks.tsx
+++ b/packages/example/src/WhatsNew/scenes/LightLeaks.tsx
@@ -2,7 +2,8 @@ import {lightLeak} from '@remotion/effects/light-leak';
import {Audio, Video} from '@remotion/media';
import React from 'react';
import {
- AbsoluteFill,
+ Track,
+ Interactive,
interpolate,
Sequence,
Series,
@@ -319,8 +320,17 @@ const TransitionDemo: React.FC = () => {
boxShadow: '0 30px 70px rgba(10,16,32,0.3)',
}}
>
- <AbsoluteFill
+ <div
style={{
+ position: 'absolute',
+ top: 0,
+ left: 0,
+ right: 0,
+ bottom: 0,
+ width: '100%',
+ height: '100%',
+ display: 'flex',
+ flexDirection: 'column',
background: showB
? 'linear-gradient(135deg, #FF5F6D, #FFC371)'
: 'linear-gradient(135deg, #0B84F3, #5B3CFF)',
@@ -334,7 +344,7 @@ const TransitionDemo: React.FC = () => {
}}
>
{showB ? 'Scene B' : 'Scene A'}
- </AbsoluteFill>
+ </div>
<Sequence from={10} durationInFrames={48} layout="none">
<TileLeak />
</Sequence>
@@ -375,14 +385,17 @@ const TileLeak: React.FC = () => {
);
};
-export const LightLeaksScene: React.FC = () => {
+const LightLeaksSceneInner: React.FC = () => {
const frame = useCurrentFrame();
const captions = getCaptionPlacement(frame, layout);
return (
- <AbsoluteFill>
+ <>
<Backdrop accent={accents.lightLeaks} />
- <Stage keyframes={layout}>
+ <Stage
+ style={{overflow: 'visible', flexDirection: 'column'}}
+ keyframes={layout}
+ >
<Series>
<Series.Sequence
name="Intro line"
@@ -908,36 +921,48 @@ export const LightLeaksScene: React.FC = () => {
]}
/>
- <Audio
- name="Sticker whoosh"
- src="https://remotion.media/whoosh.wav"
- from={4}
- volume={0.32}
- />
- <Audio
- name="Split whip"
- src="https://remotion.media/whip.wav"
- from={130}
- volume={0.18}
- />
- <Audio
- name="Grid click"
- src="https://remotion.media/mouse-click.wav"
- from={240}
- volume={0.3}
- />
- <Audio
- name="Skill switch"
- src="https://remotion.media/switch.wav"
- from={532}
- volume={0.3}
- />
- <Audio
- name="Demo whoosh"
- src="https://remotion.media/whoosh.wav"
- from={660}
- volume={0.26}
- />
- </AbsoluteFill>
+ <Track name="Sound effects">
+ <Audio
+ durationInFrames={5}
+ name="Sticker whoosh"
+ src="https://remotion.media/whoosh.wav"
+ from={4}
+ volume={0.32}
+ />
+ <Audio
+ durationInFrames={6}
+ name="Split whip"
+ src="https://remotion.media/whip.wav"
+ from={130}
+ volume={0.18}
+ />
+ <Audio
+ durationInFrames={12}
+ name="Grid click"
+ src="https://remotion.media/mouse-click.wav"
+ from={240}
+ volume={0.3}
+ />
+ <Audio
+ durationInFrames={10}
+ name="Skill switch"
+ src="https://remotion.media/switch.wav"
+ from={532}
+ volume={0.3}
+ />
+ <Audio
+ durationInFrames={5}
+ name="Demo whoosh"
+ src="https://remotion.media/whoosh.wav"
+ from={660}
+ volume={0.26}
+ />
+ </Track>
+ </>
);
};
+
+export const LightLeaksScene = Interactive.create({
+ Component: LightLeaksSceneInner,
+ layout: 'absolute-fill',
+});
diff --git a/packages/example/src/WhatsNew/scenes/Outro.tsx b/packages/example/src/WhatsNew/scenes/Outro.tsx
index 86b7a4a5ed..7cf0a274ec 100644
--- a/packages/example/src/WhatsNew/scenes/Outro.tsx
+++ b/packages/example/src/WhatsNew/scenes/Outro.tsx
@@ -1,12 +1,12 @@
import React from 'react';
-import {AbsoluteFill, interpolate, useCurrentFrame} from 'remotion';
+import {Interactive, interpolate, useCurrentFrame} from 'remotion';
import {pop, rise} from '../anim';
import {Backdrop} from '../components/Background';
import {RemotionLogo} from '../components/Logo';
import {display, mono} from '../fonts';
import {colors} from '../theme';
-export const OutroScene: React.FC = () => {
+const OutroSceneInner: React.FC = () => {
const frame = useCurrentFrame();
const logo = pop(frame, 0, 10);
const word = rise(frame, 8, 18);
@@ -18,11 +18,32 @@ export const OutroScene: React.FC = () => {
});
return (
- <AbsoluteFill style={{backgroundColor: '#000'}}>
- <AbsoluteFill style={{opacity: fade}}>
+ <>
+ <div
+ style={{
+ position: 'absolute',
+ top: 0,
+ left: 0,
+ right: 0,
+ bottom: 0,
+ width: '100%',
+ height: '100%',
+ display: 'flex',
+ flexDirection: 'column',
+ opacity: fade,
+ }}
+ >
<Backdrop accent={colors.blue} dark />
- <AbsoluteFill
+ <div
style={{
+ position: 'absolute',
+ top: 0,
+ left: 0,
+ right: 0,
+ bottom: 0,
+ width: '100%',
+ height: '100%',
+ display: 'flex',
justifyContent: 'center',
alignItems: 'center',
flexDirection: 'column',
@@ -76,8 +97,13 @@ export const OutroScene: React.FC = () => {
>
Make videos programmatically.
</div>
- </AbsoluteFill>
- </AbsoluteFill>
- </AbsoluteFill>
+ </div>
+ </div>
+ </>
);
};
+
+export const OutroScene = Interactive.create({
+ Component: OutroSceneInner,
+ layout: 'absolute-fill',
+});
diff --git a/packages/example/src/WhatsNew/scenes/Skills.tsx b/packages/example/src/WhatsNew/scenes/Skills.tsx
index 28a2559d1d..6551f8db91 100644
--- a/packages/example/src/WhatsNew/scenes/Skills.tsx
+++ b/packages/example/src/WhatsNew/scenes/Skills.tsx
@@ -2,7 +2,8 @@ import {Audio, Video} from '@remotion/media';
import {useWindowedAudioData, visualizeAudio} from '@remotion/media-utils';
import React from 'react';
import {
- AbsoluteFill,
+ Track,
+ Interactive,
interpolate,
Sequence,
Series,
@@ -310,14 +311,17 @@ const SkillGrid: React.FC = () => {
);
};
-export const SkillsScene: React.FC = () => {
+const SkillsSceneInner: React.FC = () => {
const frame = useCurrentFrame();
const captions = getCaptionPlacement(frame, layout);
return (
- <AbsoluteFill>
+ <>
<Backdrop accent={accents.skills} />
- <Stage keyframes={layout}>
+ <Stage
+ style={{overflow: 'visible', flexDirection: 'column'}}
+ keyframes={layout}
+ >
<Series>
<Series.Sequence
name="New skills"
@@ -765,48 +769,62 @@ export const SkillsScene: React.FC = () => {
]}
/>
- <Audio
- name="Sticker whoosh"
- src="https://remotion.media/whoosh.wav"
- from={0}
- volume={0.3}
- />
- <Audio
- name="Split whip"
- src="https://remotion.media/whip.wav"
- from={90}
- volume={0.16}
- />
- <Audio
- name="Card 1"
- src="https://remotion.media/mouse-click.wav"
- from={166}
- volume={0.3}
- />
- <Audio
- name="Card 2"
- src="https://remotion.media/mouse-click.wav"
- from={288}
- volume={0.3}
- />
- <Audio
- name="Card 3"
- src="https://remotion.media/mouse-click.wav"
- from={371}
- volume={0.3}
- />
- <Audio
- name="Card 4"
- src="https://remotion.media/mouse-click.wav"
- from={447}
- volume={0.3}
- />
- <Audio
- name="All checked"
- src="https://remotion.media/ding.wav"
- from={527}
- volume={0.22}
- />
- </AbsoluteFill>
+ <Track name="Sound effects">
+ <Audio
+ durationInFrames={5}
+ name="Sticker whoosh"
+ src="https://remotion.media/whoosh.wav"
+ from={0}
+ volume={0.3}
+ />
+ <Audio
+ durationInFrames={6}
+ name="Split whip"
+ src="https://remotion.media/whip.wav"
+ from={90}
+ volume={0.16}
+ />
+ <Audio
+ durationInFrames={12}
+ name="Card 1"
+ src="https://remotion.media/mouse-click.wav"
+ from={166}
+ volume={0.3}
+ />
+ <Audio
+ durationInFrames={12}
+ name="Card 2"
+ src="https://remotion.media/mouse-click.wav"
+ from={288}
+ volume={0.3}
+ />
+ <Audio
+ durationInFrames={12}
+ name="Card 3"
+ src="https://remotion.media/mouse-click.wav"
+ from={371}
+ volume={0.3}
+ />
+ <Audio
+ durationInFrames={12}
+ name="Card 4"
+ src="https://remotion.media/mouse-click.wav"
+ from={447}
+ volume={0.3}
+ />
+ <Audio
+ durationInFrames={42}
+ name="All checked"
+ src="https://remotion.media/ding.wav"
+ from={527}
+ volume={0.22}
+ />
+ </Track>
+ </>
);
};
+
+export const SkillsScene = Interactive.create({
+ Component: SkillsSceneInner,
+ layout: 'absolute-fill',
+});
diff --git a/packages/example/src/WhatsNew/scenes/SneakPeek.tsx b/packages/example/src/WhatsNew/scenes/SneakPeek.tsx
index 1d72f3eb48..7d43718f5e 100644
--- a/packages/example/src/WhatsNew/scenes/SneakPeek.tsx
+++ b/packages/example/src/WhatsNew/scenes/SneakPeek.tsx
@@ -1,7 +1,9 @@
import {Audio, Video} from '@remotion/media';
import React from 'react';
import {
- AbsoluteFill,
+ Track,
+ Interactive,
+ type InteractiveTransformProps,
interpolate,
Sequence,
Series,
@@ -39,18 +41,28 @@ const layout: LayoutKeyframe[] = [
{at: 518, layout: 'pip', duration: 26},
];
-const Spotlight: React.FC = () => {
+const SpotlightInner: React.FC<InteractiveTransformProps> = ({style}) => {
const frame = useCurrentFrame();
const p = interpolate(frame, [0, 20, 150, 184], [0, 1, 1, 0], {
extrapolateLeft: 'clamp',
extrapolateRight: 'clamp',
});
return (
- <AbsoluteFill
+ <div
style={{
+ position: 'absolute',
+ top: 0,
+ left: 0,
+ right: 0,
+ bottom: 0,
+ width: '100%',
+ height: '100%',
+ display: 'flex',
+ flexDirection: 'column',
opacity: p,
background:
'radial-gradient(ellipse 45% 60% at 52% 40%, rgba(20,10,40,0) 40%, rgba(12,6,28,0.72) 100%)',
+ ...style,
}}
/>
);
@@ -68,10 +80,10 @@ const requests = [
{text: 'Make it easier, please!', at: 67, x: 100, y: 480, rotate: -2},
];
-const Requests: React.FC = () => {
+const RequestsInner: React.FC = () => {
const frame = useCurrentFrame();
return (
- <AbsoluteFill>
+ <>
{requests.map((r, i) => {
const p = pop(frame, r.at, 11);
return (
@@ -120,7 +132,7 @@ const Requests: React.FC = () => {
</div>
);
})}
- </AbsoluteFill>
+ </>
);
};
@@ -304,14 +316,17 @@ const VisualModeTitle: React.FC = () => (
</div>
);
-export const SneakPeekScene: React.FC = () => {
+const SneakPeekSceneInner: React.FC = () => {
const frame = useCurrentFrame();
const captions = getCaptionPlacement(frame, layout);
return (
- <AbsoluteFill>
+ <>
<Backdrop accent={accents.sneakPeek} dark />
- <Stage keyframes={layout}>
+ <Stage
+ style={{overflow: 'visible', flexDirection: 'column'}}
+ keyframes={layout}
+ >
<Series>
<Series.Sequence
name="Sneak peek"
@@ -372,12 +387,8 @@ export const SneakPeekScene: React.FC = () => {
</Series>
</Stage>
- <Sequence name="Spotlight" durationInFrames={184}>
- <Spotlight />
- </Sequence>
- <Sequence name="Letterbox" durationInFrames={190}>
- <Letterbox />
- </Sequence>
+ <Spotlight name="Spotlight" durationInFrames={184} />
+ <Letterbox name="Letterbox" durationInFrames={190} />
<Sequence name="Sneak peek sticker" from={26} durationInFrames={58}>
<ChapterSticker
index={<EyeIcon size={64} color={colors.paper} strokeWidth={2.4} />}
@@ -386,9 +397,12 @@ export const SneakPeekScene: React.FC = () => {
accent={accents.soundEffects}
/>
</Sequence>
- <Sequence name="Requests" from={79} durationInFrames={104}>
- <Requests />
- </Sequence>
+ <Requests
+ name="Requests"
+ from={79}
+ durationInFrames={104}
+ style={{overflow: 'visible', flexDirection: 'column'}}
+ />
<Sequence name="Tradeoff" from={188} durationInFrames={300}>
<Tradeoff />
</Sequence>
@@ -1005,66 +1019,91 @@ export const SneakPeekScene: React.FC = () => {
]}
/>
- <Audio
- name="Shutter"
- src="https://remotion.media/shutter-old.wav"
- from={28}
- volume={0.3}
- />
- <Audio
- name="Request 1"
- src="https://remotion.media/snapchat-notification.wav"
- from={92}
- volume={0.12}
- />
- <Audio
- name="Request 2"
- src="https://remotion.media/snapchat-notification.wav"
- from={116}
- volume={0.1}
- />
- <Audio
- name="Request 3"
- src="https://remotion.media/snapchat-notification.wav"
- from={146}
- volume={0.1}
- />
- <Audio
- name="Split whoosh"
- src="https://remotion.media/whoosh.wav"
- from={182}
- volume={0.22}
- />
- <Audio
- name="Reveal whoosh"
- src="https://remotion.media/whoosh.wav"
- from={516}
- volume={0.36}
- />
- <Audio
- name="Visual mode toggle"
- src="https://remotion.media/switch.wav"
- from={554}
- volume={0.3}
- />
- <Audio
- name="Select click"
- src="https://remotion.media/mouse-click.wav"
- from={618}
- volume={0.32}
- />
- <Audio
- name="Color click"
- src="https://remotion.media/mouse-click.wav"
- from={798}
- volume={0.3}
- />
- <Audio
- name="Saved ding"
- src="https://remotion.media/ding.wav"
- from={820}
- volume={0.22}
- />
- </AbsoluteFill>
+ <Track name="Sound effects">
+ <Audio
+ durationInFrames={10}
+ name="Shutter"
+ src="https://remotion.media/shutter-old.wav"
+ from={28}
+ volume={0.3}
+ />
+ <Audio
+ durationInFrames={7}
+ name="Request 1"
+ src="https://remotion.media/snapchat-notification.wav"
+ from={92}
+ volume={0.12}
+ />
+ <Audio
+ durationInFrames={7}
+ name="Request 2"
+ src="https://remotion.media/snapchat-notification.wav"
+ from={116}
+ volume={0.1}
+ />
+ <Audio
+ durationInFrames={7}
+ name="Request 3"
+ src="https://remotion.media/snapchat-notification.wav"
+ from={146}
+ volume={0.1}
+ />
+ <Audio
+ durationInFrames={5}
+ name="Split whoosh"
+ src="https://remotion.media/whoosh.wav"
+ from={182}
+ volume={0.22}
+ />
+ <Audio
+ durationInFrames={5}
+ name="Reveal whoosh"
+ src="https://remotion.media/whoosh.wav"
+ from={516}
+ volume={0.36}
+ />
+ <Audio
+ durationInFrames={10}
+ name="Visual mode toggle"
+ src="https://remotion.media/switch.wav"
+ from={554}
+ volume={0.3}
+ />
+ <Audio
+ durationInFrames={12}
+ name="Select click"
+ src="https://remotion.media/mouse-click.wav"
+ from={618}
+ volume={0.32}
+ />
+ <Audio
+ durationInFrames={12}
+ name="Color click"
+ src="https://remotion.media/mouse-click.wav"
+ from={798}
+ volume={0.3}
+ />
+ <Audio
+ durationInFrames={42}
+ name="Saved ding"
+ src="https://remotion.media/ding.wav"
+ from={820}
+ volume={0.22}
+ />
+ </Track>
+ </>
);
};
+
+const Spotlight = Interactive.create({
+ Component: SpotlightInner,
+ layout: 'none',
+});
+const Requests = Interactive.create({
+ Component: RequestsInner,
+ layout: 'absolute-fill',
+});
+export const SneakPeekScene = Interactive.create({
+ Component: SneakPeekSceneInner,
+ layout: 'absolute-fill',
+});
diff --git a/packages/example/src/WhatsNew/scenes/SoundEffects.tsx b/packages/example/src/WhatsNew/scenes/SoundEffects.tsx
index 90847008cc..c93f248b86 100644
--- a/packages/example/src/WhatsNew/scenes/SoundEffects.tsx
+++ b/packages/example/src/WhatsNew/scenes/SoundEffects.tsx
@@ -1,7 +1,8 @@
import {Audio, Video} from '@remotion/media';
import React from 'react';
import {
- AbsoluteFill,
+ Track,
+ Interactive,
interpolate,
Sequence,
Series,
@@ -526,14 +527,17 @@ const CallForSources: React.FC = () => (
</Panel>
);
-export const SoundEffectsScene: React.FC = () => {
+const SoundEffectsSceneInner: React.FC = () => {
const frame = useCurrentFrame();
const captions = getCaptionPlacement(frame, layout);
return (
- <AbsoluteFill>
+ <>
<Backdrop accent={accents.soundEffects} />
- <Stage keyframes={layout}>
+ <Stage
+ style={{overflow: 'visible', flexDirection: 'column'}}
+ keyframes={layout}
+ >
<Series>
<Series.Sequence
name="AI is bad at finding them"
@@ -1410,66 +1414,85 @@ export const SoundEffectsScene: React.FC = () => {
]}
/>
- <Audio
- name="Sticker ding"
- src="https://remotion.media/ding.wav"
- from={2}
- volume={0.22}
- />
- <Audio
- name="Split whip"
- src="https://remotion.media/whip.wav"
- from={32}
- volume={0.16}
- />
- <Audio
- name="Error"
- src="https://remotion.media/windows-xp-error.wav"
- from={124}
- volume={0.2}
- />
- <Audio
- name="Library whoosh"
- src="https://remotion.media/whoosh.wav"
- from={188}
- volume={0.22}
- />
- <Audio
- name="Library page turn"
- src="https://remotion.media/page-turn.wav"
- from={206}
- volume={0.3}
- />
- <Audio
- name="Free stamp"
- src="https://remotion.media/shutter-modern.wav"
- from={334}
- volume={0.22}
- />
- <Audio
- name="Hotlinked whoosh"
- src="https://remotion.media/whoosh.wav"
- from={504}
- volume={0.4}
- />
- <Audio
- name="Standardized ding"
- src="https://remotion.media/ding.wav"
- from={686}
- volume={0.2}
- />
- <Audio
- name="Seven pop"
- src="https://remotion.media/mouse-click.wav"
- from={778}
- volume={0.35}
- />
- <Audio
- name="Back to split"
- src="https://remotion.media/whip.wav"
- from={880}
- volume={0.16}
- />
- </AbsoluteFill>
+ <Track name="Sound effects">
+ <Audio
+ durationInFrames={42}
+ name="Sticker ding"
+ src="https://remotion.media/ding.wav"
+ from={2}
+ volume={0.22}
+ />
+ <Audio
+ durationInFrames={30}
+ name="Error"
+ src="https://remotion.media/windows-xp-error.wav"
+ from={124}
+ volume={0.2}
+ />
+ <Audio
+ durationInFrames={5}
+ name="Library whoosh"
+ src="https://remotion.media/whoosh.wav"
+ from={188}
+ volume={0.22}
+ />
+ <Audio
+ durationInFrames={12}
+ name="Library page turn"
+ src="https://remotion.media/page-turn.wav"
+ from={206}
+ volume={0.3}
+ />
+ <Audio
+ durationInFrames={15}
+ name="Free stamp"
+ src="https://remotion.media/shutter-modern.wav"
+ from={334}
+ volume={0.22}
+ />
+ <Audio
+ durationInFrames={5}
+ name="Hotlinked whoosh"
+ src="https://remotion.media/whoosh.wav"
+ from={504}
+ volume={0.4}
+ />
+ <Audio
+ durationInFrames={42}
+ name="Standardized ding"
+ src="https://remotion.media/ding.wav"
+ from={686}
+ volume={0.2}
+ />
+ <Audio
+ durationInFrames={12}
+ name="Seven pop"
+ src="https://remotion.media/mouse-click.wav"
+ from={778}
+ volume={0.35}
+ />
+ <Audio
+ durationInFrames={6}
+ name="Back to split"
+ src="https://remotion.media/whip.wav"
+ from={880}
+ volume={0.16}
+ />
+ </Track>
+ <Track name="Overlapping sound effects">
+ <Audio
+ durationInFrames={6}
+ name="Split whip"
+ src="https://remotion.media/whip.wav"
+ from={32}
+ volume={0.16}
+ />
+ </Track>
+ </>
);
};
+
+export const SoundEffectsScene = Interactive.create({
+ Component: SoundEffectsSceneInner,
+ layout: 'absolute-fill',
+});
diff --git a/packages/example/src/WhatsNew/scenes/Vercel.tsx b/packages/example/src/WhatsNew/scenes/Vercel.tsx
index 718451dccc..01204920a7 100644
--- a/packages/example/src/WhatsNew/scenes/Vercel.tsx
+++ b/packages/example/src/WhatsNew/scenes/Vercel.tsx
@@ -1,7 +1,8 @@
import {Audio, Video} from '@remotion/media';
import React from 'react';
import {
- AbsoluteFill,
+ Track,
+ Interactive,
interpolate,
Sequence,
Series,
@@ -484,14 +485,17 @@ const FirstClass: React.FC = () => (
</div>
);
-export const VercelScene: React.FC = () => {
+const VercelSceneInner: React.FC = () => {
const frame = useCurrentFrame();
const captions = getCaptionPlacement(frame, layout);
return (
- <AbsoluteFill>
+ <>
<Backdrop accent="#6B7280" />
- <Stage keyframes={layout}>
+ <Stage
+ style={{overflow: 'visible', flexDirection: 'column'}}
+ keyframes={layout}
+ >
<Series>
<Series.Sequence
name="Render on Vercel"
@@ -1231,54 +1235,69 @@ export const VercelScene: React.FC = () => {
]}
/>
- <Audio
- name="Sticker whoosh"
- src="https://remotion.media/whoosh.wav"
- from={0}
- volume={0.3}
- />
- <Audio
- name="Logos click"
- src="https://remotion.media/mouse-click.wav"
- from={76}
- volume={0.3}
- />
- <Audio
- name="Typing"
- src="https://remotion.media/switch.wav"
- from={300}
- volume={0.2}
- />
- <Audio
- name="Template page turn"
- src="https://remotion.media/page-turn.wav"
- from={512}
- volume={0.28}
- />
- <Audio
- name="First-class stamp"
- src="https://remotion.media/shutter-modern.wav"
- from={666}
- volume={0.22}
- />
- <Audio
- name="Split whip"
- src="https://remotion.media/whip.wav"
- from={798}
- volume={0.16}
- />
- <Audio
- name="Easiest ding"
- src="https://remotion.media/ding.wav"
- from={846}
- volume={0.2}
- />
- <Audio
- name="Tutorial pop"
- src="https://remotion.media/mouse-click.wav"
- from={972}
- volume={0.3}
- />
- </AbsoluteFill>
+ <Track name="Sound effects">
+ <Audio
+ durationInFrames={5}
+ name="Sticker whoosh"
+ src="https://remotion.media/whoosh.wav"
+ from={0}
+ volume={0.3}
+ />
+ <Audio
+ durationInFrames={12}
+ name="Logos click"
+ src="https://remotion.media/mouse-click.wav"
+ from={76}
+ volume={0.3}
+ />
+ <Audio
+ durationInFrames={10}
+ name="Typing"
+ src="https://remotion.media/switch.wav"
+ from={300}
+ volume={0.2}
+ />
+ <Audio
+ durationInFrames={12}
+ name="Template page turn"
+ src="https://remotion.media/page-turn.wav"
+ from={512}
+ volume={0.28}
+ />
+ <Audio
+ durationInFrames={15}
+ name="First-class stamp"
+ src="https://remotion.media/shutter-modern.wav"
+ from={666}
+ volume={0.22}
+ />
+ <Audio
+ durationInFrames={6}
+ name="Split whip"
+ src="https://remotion.media/whip.wav"
+ from={798}
+ volume={0.16}
+ />
+ <Audio
+ durationInFrames={42}
+ name="Easiest ding"
+ src="https://remotion.media/ding.wav"
+ from={846}
+ volume={0.2}
+ />
+ <Audio
+ durationInFrames={12}
+ name="Tutorial pop"
+ src="https://remotion.media/mouse-click.wav"
+ from={972}
+ volume={0.3}
+ />
+ </Track>
+ </>
);
};
+
+export const VercelScene = Interactive.create({
+ Component: VercelSceneInner,
+ layout: 'absolute-fill',
+});
diff --git a/packages/jonnys-videos/src/disco-light-show/Composition.tsx b/packages/jonnys-videos/src/disco-light-show/Composition.tsx
index 5c130b8cbb..c000e0a5b0 100644
--- a/packages/jonnys-videos/src/disco-light-show/Composition.tsx
+++ b/packages/jonnys-videos/src/disco-light-show/Composition.tsx
@@ -253,64 +253,81 @@ const MyComponentInner: React.FC = () => {
),
}}
/>
- <EffectShow
- name="EffectShow"
- width={1080}
- height={1920}
- durationInFrames={197}
- style={{
- position: 'absolute',
- translate: interpolate(
- frame,
- [337, 352],
- ['0px 1920px', '0px -330.8px'],
- {
+ <Track name="Effect and model demos">
+ <EffectShow
+ name="EffectShow"
+ width={1080}
+ height={1920}
+ durationInFrames={197}
+ style={{
+ position: 'absolute',
+ translate: interpolate(
+ frame,
+ [337, 352],
+ ['0px 1920px', '0px -330.8px'],
+ {
+ extrapolateLeft: 'clamp',
+ extrapolateRight: 'clamp',
+ easing: [
+ Easing.spring({
+ damping: 200,
+ mass: 1,
+ stiffness: 100,
+ allowTail: true,
+ durationRestThreshold: 0.02,
+ overshootClamping: false,
+ }),
+ ],
+ },
+ ),
+ scale: interpolate(frame, [512, 522], [1, 0], {
extrapolateLeft: 'clamp',
extrapolateRight: 'clamp',
+ output: 'perceptual-scale',
easing: [
Easing.spring({
damping: 200,
mass: 1,
stiffness: 100,
- allowTail: true,
- durationRestThreshold: 0.02,
+ allowTail: false,
+ durationRestThreshold: 0.01,
overshootClamping: false,
}),
],
- },
- ),
- scale: interpolate(frame, [512, 522], [1, 0], {
- extrapolateLeft: 'clamp',
- extrapolateRight: 'clamp',
- output: 'perceptual-scale',
- easing: [
- Easing.spring({
- damping: 200,
- mass: 1,
- stiffness: 100,
- allowTail: false,
- durationRestThreshold: 0.01,
- overshootClamping: false,
- }),
- ],
- }),
- }}
- from={337}
- />
- <HuggingFace
- name="HuggingFace"
- width={1920}
- height={1080}
- durationInFrames={162}
- style={{
- position: 'absolute',
- translate: interpolate(
- frame,
- [567, 575],
- ['704.8px 79.9px', '-420px 79.9px'],
- {
+ }),
+ }}
+ from={337}
+ />
+ <HuggingFace
+ name="HuggingFace"
+ width={1920}
+ height={1080}
+ durationInFrames={162}
+ style={{
+ position: 'absolute',
+ translate: interpolate(
+ frame,
+ [567, 575],
+ ['704.8px 79.9px', '-420px 79.9px'],
+ {
+ extrapolateLeft: 'clamp',
+ extrapolateRight: 'clamp',
+ easing: [
+ Easing.spring({
+ damping: 200,
+ mass: 1,
+ stiffness: 100,
+ allowTail: true,
+ durationRestThreshold: 0.02,
+ overshootClamping: false,
+ }),
+ ],
+ },
+ ),
+ scale: interpolate(frame, [692, 697], [0.707, 0], {
extrapolateLeft: 'clamp',
extrapolateRight: 'clamp',
+ output: 'perceptual-scale',
easing: [
Easing.spring({
damping: 200,
@@ -321,26 +338,11 @@ const MyComponentInner: React.FC = () => {
overshootClamping: false,
}),
],
- },
- ),
- scale: interpolate(frame, [692, 697], [0.707, 0], {
- extrapolateLeft: 'clamp',
- extrapolateRight: 'clamp',
- output: 'perceptual-scale',
- easing: [
- Easing.spring({
- damping: 200,
- mass: 1,
- stiffness: 100,
- allowTail: true,
- durationRestThreshold: 0.02,
- overshootClamping: false,
- }),
- ],
- }),
- }}
- from={537}
- />
+ }),
+ }}
+ from={537}
+ />
+ </Track>
<ClientSideChad
name="ClientSideChad"
width={1080}
diff --git a/packages/jonnys-videos/src/disco-light-show/Countdown.tsx b/packages/jonnys-videos/src/disco-light-show/Countdown.tsx
index e16f44a968..1a82cf7cf2 100644
--- a/packages/jonnys-videos/src/disco-light-show/Countdown.tsx
+++ b/packages/jonnys-videos/src/disco-light-show/Countdown.tsx
@@ -1,5 +1,6 @@
import React from 'react';
import {
+ Track,
useVideoConfig,
AbsoluteFill,
Easing,
@@ -79,19 +80,21 @@ const CountdownPage = Interactive.create({
const CountdownInner: React.FC = () => {
return (
<>
- <CountdownPage name="Countdown 3" number="3" durationInFrames={20} />
- <CountdownPage
- name="Countdown 2"
- number="2"
- from={20}
- durationInFrames={20}
- />
- <CountdownPage
- name="Countdown 1"
- number="1"
- from={40}
- durationInFrames={19}
- />
+ <Track name="Countdown numbers">
+ <CountdownPage name="Countdown 3" number="3" durationInFrames={20} />
+ <CountdownPage
+ name="Countdown 2"
+ number="2"
+ from={20}
+ durationInFrames={20}
+ />
+ <CountdownPage
+ name="Countdown 1"
+ number="1"
+ from={40}
+ durationInFrames={19}
+ />
+ </Track>
</>
);
};
diff --git a/packages/jonnys-videos/src/plane-sight/Composition.tsx b/packages/jonnys-videos/src/plane-sight/Composition.tsx
index f3af2a3836..4fd485ae41 100644
--- a/packages/jonnys-videos/src/plane-sight/Composition.tsx
+++ b/packages/jonnys-videos/src/plane-sight/Composition.tsx
@@ -1,4 +1,4 @@
-import {AbsoluteFill, Series, useVideoConfig} from 'remotion';
+import {Track, AbsoluteFill, Series, useVideoConfig} from 'remotion';
import {AirportDemo, FiveAgentsIntro} from './FiveAgentDemo';
import {FlightCrewScene} from './FlightCrewScene';
import {PresenterNarration} from './PresenterNarration';
@@ -8,15 +8,17 @@ export const PlaneSightPromo = () => {
return (
<AbsoluteFill style={{backgroundColor: '#ffffff'}}>
- <FiveAgentsIntro
- name="Opening β€” five agents in Herdr"
- durationInFrames={8.1 * fps}
- />
- <AirportDemo
- name="Airport β€” depart, work, return"
- from={(344 / 30) * fps}
- durationInFrames={(496 / 30) * fps}
- />
+ <Track name="Opening cutaways">
+ <FiveAgentsIntro
+ name="Opening β€” five agents in Herdr"
+ durationInFrames={8.1 * fps}
+ />
+ <AirportDemo
+ name="Airport β€” depart, work, return"
+ from={(344 / 30) * fps}
+ durationInFrames={(496 / 30) * fps}
+ />
+ </Track>
<Series name="Promo scenes" layout="absolute-fill">
<Series.Sequence
name="Narration β€” through crucial"
diff --git a/packages/jonnys-videos/src/plane-sight/PresenterNarration.tsx b/packages/jonnys-videos/src/plane-sight/PresenterNarration.tsx
index 22148f74cd..36ef6293aa 100644
--- a/packages/jonnys-videos/src/plane-sight/PresenterNarration.tsx
+++ b/packages/jonnys-videos/src/plane-sight/PresenterNarration.tsx
@@ -1,5 +1,6 @@
import {Audio, Video} from '@remotion/media';
import {
+ Track,
AbsoluteFill,
CanvasImage,
type InteractiveTransformProps,
@@ -56,53 +57,55 @@ const PresenterNarrationContent = ({style}: InteractiveTransformProps) => {
objectFit: 'cover',
}}
/>
- <GeminiTowerScene
- name="Gemini β€” control tower hover"
- from={(1588 / 30) * fps}
- durationInFrames={(157 / 30) * fps}
- />
- <HerdrGroundControl
- name="Herdr β€” send and return to the airport automatically"
- from={(1745 / 30) * fps}
- durationInFrames={(252 / 30) * fps}
- />
- <TaxiwayDependencies
- name="Identifies dependencies β€” zoom into taxiway"
- from={(1412 / 30) * fps}
- durationInFrames={(176 / 30) * fps}
- />
- <FrontOfLineZoom
- name="In front of the line β€” priority-one plane"
- from={Math.round((1321 / 30) * fps)}
- durationInFrames={Math.round((91 / 30) * fps)}
- />
- <AirportSignZoom
- name="Agent Airport International β€” zoom into sign"
- from={(2018 / 30) * fps}
- durationInFrames={Math.round((69 / 30) * fps)}
- />
- <EntireCommitsBroll
- name="Operated by Entire β€” PlaneSight commit history"
- from={Math.round((2087 / 30) * fps)}
- durationInFrames={Math.round((169 / 30) * fps)}
- />
- <TowerZoom
- name="Air traffic controller β€” tower introduction"
- from={Math.round((994 / 30) * fps)}
- durationInFrames={Math.round((62 / 30) * fps)}
- afterHerdr={false}
- />
- <TowerZoom
- name="Air traffic controller β€” tower callback"
- from={Math.round((2529 / 30) * fps)}
- durationInFrames={Math.round((62 / 30) * fps)}
- afterHerdr
- />
- <FiveAgentsIntro
- name="Closing β€” five agents in Herdr"
- from={75.2 * fps}
- durationInFrames={8.1 * fps}
- />
+ <Track name="Airport cutaways">
+ <GeminiTowerScene
+ name="Gemini β€” control tower hover"
+ from={(1588 / 30) * fps}
+ durationInFrames={(157 / 30) * fps}
+ />
+ <HerdrGroundControl
+ name="Herdr β€” send and return to the airport automatically"
+ from={(1745 / 30) * fps}
+ durationInFrames={(252 / 30) * fps}
+ />
+ <TaxiwayDependencies
+ name="Identifies dependencies β€” zoom into taxiway"
+ from={(1412 / 30) * fps}
+ durationInFrames={(176 / 30) * fps}
+ />
+ <FrontOfLineZoom
+ name="In front of the line β€” priority-one plane"
+ from={Math.round((1321 / 30) * fps)}
+ durationInFrames={Math.round((91 / 30) * fps)}
+ />
+ <AirportSignZoom
+ name="Agent Airport International β€” zoom into sign"
+ from={(2018 / 30) * fps}
+ durationInFrames={Math.round((69 / 30) * fps)}
+ />
+ <EntireCommitsBroll
+ name="Operated by Entire β€” PlaneSight commit history"
+ from={Math.round((2087 / 30) * fps)}
+ durationInFrames={Math.round((169 / 30) * fps)}
+ />
+ <TowerZoom
+ name="Air traffic controller β€” tower introduction"
+ from={Math.round((994 / 30) * fps)}
+ durationInFrames={Math.round((62 / 30) * fps)}
+ afterHerdr={false}
+ />
+ <TowerZoom
+ name="Air traffic controller β€” tower callback"
+ from={Math.round((2529 / 30) * fps)}
+ durationInFrames={Math.round((62 / 30) * fps)}
+ afterHerdr
+ />
+ <FiveAgentsIntro
+ name="Closing β€” five agents in Herdr"
+ from={75.2 * fps}
+ durationInFrames={8.1 * fps}
+ />
+ </Track>
<Interactive.Div
name="Presenter circle"
style={{
@@ -131,22 +134,24 @@ const PresenterNarrationContent = ({style}: InteractiveTransformProps) => {
}}
/>
</Interactive.Div>
- <PlaneSightLogo
- name="Plane Sight introduction"
- from={(362 / 30) * fps}
- durationInFrames={(82 / 30) * fps}
- />
- <PlaneSightLogo
- name="Plane Sight air traffic controller"
- from={(946 / 30) * fps}
- durationInFrames={(48 / 30) * fps}
- />
- <PlaneSightLogo
- name="Plane Sight closing β€” logo only"
- from={(2728 / 30) * fps}
- durationInFrames={(27 / 30) * fps}
- style={{backgroundColor: '#ffffff', zIndex: 10}}
- />
+ <Track name="Plane Sight logos">
+ <PlaneSightLogo
+ name="Plane Sight introduction"
+ from={(362 / 30) * fps}
+ durationInFrames={(82 / 30) * fps}
+ />
+ <PlaneSightLogo
+ name="Plane Sight air traffic controller"
+ from={(946 / 30) * fps}
+ durationInFrames={(48 / 30) * fps}
+ />
+ <PlaneSightLogo
+ name="Plane Sight closing β€” logo only"
+ from={(2728 / 30) * fps}
+ durationInFrames={(27 / 30) * fps}
+ style={{backgroundColor: '#ffffff', zIndex: 10}}
+ />
+ </Track>
<EntireTrailsOverlay
name="Entire Trails wink β€” 1.5 seconds on trails"
from={Math.round((679 / 30) * fps)}
diff --git a/packages/jonnys-videos/src/roller-skis-new/scenes/GearUp.tsx b/packages/jonnys-videos/src/roller-skis-new/scenes/GearUp.tsx
index 803739ac0e..742de9090b 100644
--- a/packages/jonnys-videos/src/roller-skis-new/scenes/GearUp.tsx
+++ b/packages/jonnys-videos/src/roller-skis-new/scenes/GearUp.tsx
@@ -1,6 +1,6 @@
import {Video} from '@remotion/media';
import React from 'react';
-import {AbsoluteFill, Interactive, Series} from 'remotion';
+import {Track, AbsoluteFill, Interactive, Series} from 'remotion';
import {PoppingWordCaptions} from '../elements/popping-word-captions';
import {SpeedBadge} from '../elements/SpeedBadge';
import {TitleCard} from '../elements/TitleCard';
@@ -150,27 +150,29 @@ const GearUpInner: React.FC = () => {
kicker="ZΓΌrich Β· 8 AM"
accentColor="#2563eb"
/>
- <SpeedBadge
- name="6x badge"
- from={6}
- durationInFrames={82}
- speed="6Γ—"
- style={{position: 'absolute', right: 80, top: 70}}
- />
- <SpeedBadge
- name="8x badge"
- from={127}
- durationInFrames={72}
- speed={'12x'}
- style={{position: 'absolute', right: 80, top: 70}}
- />
- <SpeedBadge
- name="2x badge"
- from={257}
- durationInFrames={75}
- speed="2Γ—"
- style={{position: 'absolute', right: 80, top: 70}}
- />
+ <Track name="Speed badges">
+ <SpeedBadge
+ name="6x badge"
+ from={6}
+ durationInFrames={82}
+ speed="6Γ—"
+ style={{position: 'absolute', right: 80, top: 70}}
+ />
+ <SpeedBadge
+ name="8x badge"
+ from={127}
+ durationInFrames={72}
+ speed={'12x'}
+ style={{position: 'absolute', right: 80, top: 70}}
+ />
+ <SpeedBadge
+ name="2x badge"
+ from={257}
+ durationInFrames={75}
+ speed="2Γ—"
+ style={{position: 'absolute', right: 80, top: 70}}
+ />
+ </Track>
</AbsoluteFill>
);
};
diff --git a/packages/jonnys-videos/src/roller-skis/Composition.tsx b/packages/jonnys-videos/src/roller-skis/Composition.tsx
index b958f5d5e7..249582d981 100644
--- a/packages/jonnys-videos/src/roller-skis/Composition.tsx
+++ b/packages/jonnys-videos/src/roller-skis/Composition.tsx
@@ -4,6 +4,7 @@ import {vignette} from '@remotion/effects/vignette';
import {Audio, Video} from '@remotion/media';
import {TransitionSeries} from '@remotion/transitions';
import {
+ Track,
Interactive,
AbsoluteFill,
Composition,
@@ -129,51 +130,53 @@ const PresenterZoomInner: React.FC = () => {
return (
<AbsoluteFill showInTimeline={false} style={{transform: `scale(${zoom})`}}>
- <Video
- src={rollerSkiAsset('footage/webcam1790843295628.mp4')}
- durationInFrames={436}
- trimBefore={120}
- style={videoStyle}
- objectFit="cover"
- effects={[
- lut({content: studioLut}),
- vignette({
- amount: interpolate(frame, [423, 466], [0, 0.55], {
- extrapolateLeft: 'clamp',
- extrapolateRight: 'clamp',
- }),
+ <Track name="Presenter footage">
+ <Video
+ src={rollerSkiAsset('footage/webcam1790843295628.mp4')}
+ durationInFrames={436}
+ trimBefore={120}
+ style={videoStyle}
+ objectFit="cover"
+ effects={[
+ lut({content: studioLut}),
+ vignette({
+ amount: interpolate(frame, [423, 466], [0, 0.55], {
+ extrapolateLeft: 'clamp',
+ extrapolateRight: 'clamp',
+ }),
- radius: 0.62,
- feather: 0.35,
- roundness: 1,
- center: [0.5, 0.5],
- color: '#000000',
- }),
- ]}
- />
- <Video
- src={rollerSkiAsset('footage/webcam1790843295628.mp4')}
- from={436}
- trimBefore={556}
- style={videoStyle}
- objectFit="cover"
- effects={[
- lut({content: studioLut}),
- vignette({
- amount: interpolate(frame, [409, 485], [0, 0.55], {
- extrapolateLeft: 'clamp',
- extrapolateRight: 'clamp',
+ radius: 0.62,
+ feather: 0.35,
+ roundness: 1,
+ center: [0.5, 0.5],
+ color: '#000000',
}),
+ ]}
+ />
+ <Video
+ src={rollerSkiAsset('footage/webcam1790843295628.mp4')}
+ from={436}
+ trimBefore={556}
+ style={videoStyle}
+ objectFit="cover"
+ effects={[
+ lut({content: studioLut}),
+ vignette({
+ amount: interpolate(frame, [409, 485], [0, 0.55], {
+ extrapolateLeft: 'clamp',
+ extrapolateRight: 'clamp',
+ }),
- radius: 0.63,
- feather: 0.67,
- roundness: 1,
- center: [0.5, 0.5],
- color: '#000000',
- }),
- ]}
- toneFrequency={0.95}
- />
+ radius: 0.63,
+ feather: 0.67,
+ roundness: 1,
+ center: [0.5, 0.5],
+ color: '#000000',
+ }),
+ ]}
+ toneFrequency={0.95}
+ />
+ </Track>
</AbsoluteFill>
);
};
@@ -1743,84 +1746,88 @@ const RollerSkiRoughCutInner: React.FC = () => {
objectFit="cover"
effects={[lut({content: studioLut})]}
/>
- <Sequence
- name="Hackathon half-marathon b-roll"
- from={7.2 * FPS}
- durationInFrames={9 * FPS}
- >
- <Video
- src={rollerSkiAsset('footage/jonny-hackathon-half-marathon.mp4')}
- muted
- style={videoStyle}
- objectFit="cover"
- />
- <div
- style={{
- position: 'absolute',
- top: 52,
- left: 64,
- maxWidth: 900,
- padding: '18px 24px',
- borderRadius: 10,
- backgroundColor: 'rgba(12, 18, 22, 0.82)',
- color: 'white',
- fontFamily: 'Arial, Helvetica, sans-serif',
- boxShadow: '0 8px 30px rgba(0, 0, 0, 0.24)',
- display: 'flex',
- alignItems: 'center',
- gap: 16,
- }}
+ <Track name="Roller skiing b-roll">
+ <Sequence
+ name="Hackathon half-marathon b-roll"
+ from={7.2 * FPS}
+ durationInFrames={9 * FPS}
>
- <WhiteYouTubeIcon />
- <div>
- <div style={{fontSize: 27, fontWeight: 700, lineHeight: 1.2}}>
- Jonny Burger
- </div>
- <div style={{fontSize: 23, lineHeight: 1.25, marginTop: 5}}>
- Winning Europe's biggest hackathon
+ <Video
+ src={rollerSkiAsset(
+ 'footage/jonny-hackathon-half-marathon.mp4',
+ )}
+ muted
+ style={videoStyle}
+ objectFit="cover"
+ />
+ <div
+ style={{
+ position: 'absolute',
+ top: 52,
+ left: 64,
+ maxWidth: 900,
+ padding: '18px 24px',
+ borderRadius: 10,
+ backgroundColor: 'rgba(12, 18, 22, 0.82)',
+ color: 'white',
+ fontFamily: 'Arial, Helvetica, sans-serif',
+ boxShadow: '0 8px 30px rgba(0, 0, 0, 0.24)',
+ display: 'flex',
+ alignItems: 'center',
+ gap: 16,
+ }}
+ >
+ <WhiteYouTubeIcon />
+ <div>
+ <div style={{fontSize: 27, fontWeight: 700, lineHeight: 1.2}}>
+ Jonny Burger
+ </div>
+ <div style={{fontSize: 23, lineHeight: 1.25, marginTop: 5}}>
+ Winning Europe's biggest hackathon
+ </div>
</div>
</div>
- </div>
- </Sequence>
- <Sequence
- name="SkiErg demonstration b-roll"
- from={24.2 * FPS}
- durationInFrames={5.5 * FPS}
- >
- <Video
- src={rollerSkiAsset('footage/skierg-hwpo-broll.mp4')}
- muted
- style={videoStyle}
- objectFit="cover"
- />
- <div
- style={{
- position: 'absolute',
- top: 52,
- left: 64,
- maxWidth: 900,
- padding: '18px 24px',
- borderRadius: 10,
- backgroundColor: 'rgba(12, 18, 22, 0.82)',
- color: 'white',
- fontFamily: 'Arial, Helvetica, sans-serif',
- boxShadow: '0 8px 30px rgba(0, 0, 0, 0.24)',
- display: 'flex',
- alignItems: 'center',
- gap: 16,
- }}
+ </Sequence>
+ <Sequence
+ name="SkiErg demonstration b-roll"
+ from={24.2 * FPS}
+ durationInFrames={5.5 * FPS}
>
- <WhiteYouTubeIcon />
- <div>
- <div style={{fontSize: 27, fontWeight: 700, lineHeight: 1.2}}>
- Mat Fraser | HWPO
- </div>
- <div style={{fontSize: 23, lineHeight: 1.25, marginTop: 5}}>
- What is the SkiErg? Tips &amp; Tricks for HYROX
+ <Video
+ src={rollerSkiAsset('footage/skierg-hwpo-broll.mp4')}
+ muted
+ style={videoStyle}
+ objectFit="cover"
+ />
+ <div
+ style={{
+ position: 'absolute',
+ top: 52,
+ left: 64,
+ maxWidth: 900,
+ padding: '18px 24px',
+ borderRadius: 10,
+ backgroundColor: 'rgba(12, 18, 22, 0.82)',
+ color: 'white',
+ fontFamily: 'Arial, Helvetica, sans-serif',
+ boxShadow: '0 8px 30px rgba(0, 0, 0, 0.24)',
+ display: 'flex',
+ alignItems: 'center',
+ gap: 16,
+ }}
+ >
+ <WhiteYouTubeIcon />
+ <div>
+ <div style={{fontSize: 27, fontWeight: 700, lineHeight: 1.2}}>
+ Mat Fraser | HWPO
+ </div>
+ <div style={{fontSize: 23, lineHeight: 1.25, marginTop: 5}}>
+ What is the SkiErg? Tips &amp; Tricks for HYROX
+ </div>
</div>
</div>
- </div>
- </Sequence>
+ </Sequence>
+ </Track>
<BasicCaptions
name="Why roller skiing captions"
captions={[
@@ -3945,34 +3952,36 @@ const RollerSkiRoughCutInner: React.FC = () => {
),
}}
/>
- <Audio
- name="No School Today music"
- src={rollerSkiAsset('audio/no-school-today-femme-tov.wav')}
- from={2212}
- durationInFrames={450}
- volume={(audioFrame) =>
- interpolate(
- audioFrame,
- [0, 12, 48, 78, 390, 414, 449],
- [0, 0.22, 0.22, 0.5, 0.5, 0.26, 0],
- {extrapolateLeft: 'clamp', extrapolateRight: 'clamp'},
- )
- }
- />
- <Audio
- name="No School Today music (end card)"
- src={rollerSkiAsset('audio/no-school-today-femme-tov.wav')}
- from={END_CARD_START + 20}
- durationInFrames={END_CARD_DURATION_IN_FRAMES}
- volume={(audioFrame) =>
- interpolate(
- audioFrame,
- [0, 12, 10 * FPS, END_CARD_DURATION_IN_FRAMES - 1],
- [0, 0.2, 0.2, 0],
- {extrapolateLeft: 'clamp', extrapolateRight: 'clamp'},
- )
- }
- />
+ <Track name="Music">
+ <Audio
+ name="No School Today music"
+ src={rollerSkiAsset('audio/no-school-today-femme-tov.wav')}
+ from={2212}
+ durationInFrames={450}
+ volume={(audioFrame) =>
+ interpolate(
+ audioFrame,
+ [0, 12, 48, 78, 390, 414, 449],
+ [0, 0.22, 0.22, 0.5, 0.5, 0.26, 0],
+ {extrapolateLeft: 'clamp', extrapolateRight: 'clamp'},
+ )
+ }
+ />
+ <Audio
+ name="No School Today music (end card)"
+ src={rollerSkiAsset('audio/no-school-today-femme-tov.wav')}
+ from={END_CARD_START + 20}
+ durationInFrames={END_CARD_DURATION_IN_FRAMES}
+ volume={(audioFrame) =>
+ interpolate(
+ audioFrame,
+ [0, 12, 10 * FPS, END_CARD_DURATION_IN_FRAMES - 1],
+ [0, 0.2, 0.2, 0],
+ {extrapolateLeft: 'clamp', extrapolateRight: 'clamp'},
+ )
+ }
+ />
+ </Track>
</>
);
};