Skip to content

🎥 Make videos programmatically with React

add failing example

Jonny Burgeraaff65526dd4
diff --git a/packages/example/src/Video.tsx b/packages/example/src/Video.tsx
index 06973e9c5e..c4c38706a1 100644
--- a/packages/example/src/Video.tsx
+++ b/packages/example/src/Video.tsx
@@ -70,6 +70,15 @@ export const Index: React.FC = () => {
};
}, []);
+ const failingCalculateMetadata: CalculateMetadataFunction<
+ z.infer<typeof dynamicDurationSchema>
+ > = useCallback(async () => {
+ await new Promise((r) => {
+ setTimeout(r, 1000);
+ });
+ throw new Error('Failed to calculate metadata');
+ }, []);
+
return (
<>
<Folder name="dynamic-parameters">
@@ -84,6 +93,17 @@ export const Index: React.FC = () => {
schema={dynamicDurationSchema}
defaultProps={{duration: 50}}
/>
+ <Composition
+ id="failing-dynmiac-length"
+ component={DynamicDuration}
+ width={1080}
+ height={1080}
+ fps={30}
+ durationInFrames={100}
+ calculateMetadata={failingCalculateMetadata}
+ schema={dynamicDurationSchema}
+ defaultProps={{duration: 50}}
+ />
</Folder>
<Folder name="components">
<Composition