Skip to content

🎥 Make videos programmatically with React

remotion.dev/brand: Premount nested compositions

JonnyBurgerb348a2f0417d
diff --git a/packages/brand/src/NestingCompositions.tsx b/packages/brand/src/NestingCompositions.tsx
index 2f1545950d..6190012b89 100644
--- a/packages/brand/src/NestingCompositions.tsx
+++ b/packages/brand/src/NestingCompositions.tsx
@@ -4,12 +4,12 @@ import {
AbsoluteFill,
Composition,
Easing,
+ Interactive,
interpolate,
- Sequence,
useCurrentFrame,
} from 'remotion';
-export function Precomposition() {
+const PrecompositionInner = () => {
const frame = useCurrentFrame();
return (
<AbsoluteFill
@@ -500,22 +500,26 @@ export function Precomposition() {
/>
</AbsoluteFill>
);
-}
+};
+
+export const Precomposition = Interactive.withSchema({
+ Component: PrecompositionInner,
+ componentName: 'Precomposition',
+ schema: {},
+ wrapInSequence: true,
+ layout: 'absolute-fill',
+});
export const NestingCompositionsPreview = () => {
return (
<>
- <Sequence layout="none" name={'Precomposition'} durationInFrames={158}>
- <Precomposition />
- </Sequence>
- <Sequence
- layout="none"
+ <Precomposition name={'Precomposition'} durationInFrames={158} />
+ <Precomposition
name={'Precomposition'}
from={158}
trimBefore={186}
- >
- <Precomposition />
- </Sequence>
+ premountFor={60}
+ />
</>
);
};
diff --git a/packages/brand/src/Root.tsx b/packages/brand/src/Root.tsx
index eb38460461..0a551e27fb 100644
--- a/packages/brand/src/Root.tsx
+++ b/packages/brand/src/Root.tsx
@@ -800,7 +800,9 @@ export const Scene11: React.FC<{platform: EndCardPlatform}> = ({platform}) => {
<KeyframeMove />
<PitchCorrection />
<RenderOnWeb />
- <NestingCompositions />
+ <Folder name="NestingCompositions">
+ <NestingCompositions />
+ </Folder>
</Folder>
<Folder name="StudioAssets">