Skip to content

🎥 Make videos programmatically with React

better document SSR

Jonny Burger1e8e070d299c
diff --git a/packages/docs/docs/dynamic-metadata.md b/packages/docs/docs/dynamic-metadata.md
index 488032694e..a032962b68 100644
--- a/packages/docs/docs/dynamic-metadata.md
+++ b/packages/docs/docs/dynamic-metadata.md
@@ -84,6 +84,29 @@ export const Index: React.FC = () => {
}
```
+## Change metadata in server-side rendering
+
+Both `getCompositions()` and `renderFrames()` functions accept an `inputProps` object as a parameter.
+
+```tsx
+getCompositions(bundled, {
+ inputProps: {
+ custom: 'data'
+ }
+})
+```
+
+```tsx
+renderFrames({
+ // ...
+ inputProps: {
+ custom: 'data'
+ }
+})
+```
+
+Make sure to pass the parameter to both of these functions, so the input props are available to `getInputProps` during the composition fetching and rendering stage.
+
## See also
- [`getInputProps()`](get-input-props)
diff --git a/packages/docs/docs/ssr.md b/packages/docs/docs/ssr.md
index e00ef89dff..287bae23ee 100644
--- a/packages/docs/docs/ssr.md
+++ b/packages/docs/docs/ssr.md
@@ -34,7 +34,14 @@ const start = async () => {
// Extract all the compositions you have defined in your project
// from the webpack bundle.
- const comps = await getCompositions(bundled);
+ const comps = await getCompositions(bundled, {
+ // You can pass custom input props that you can retrieve using getInputProps()
+ // in the composition list. Use this if you want to dynamically set the duration or
+ // dimensions of the video.
+ inputProps: {
+ custom: 'data'
+ }
+ });
// Select the composition you want to render.
const video = comps.find((c) => c.id === compositionId);