Skip to content

🎥 Make videos programmatically with React

types

Jonny Burgerd429232448cd
diff --git a/packages/docs/docs/ssr.md b/packages/docs/docs/ssr.md
index d91d3272b7..20c70c511c 100644
--- a/packages/docs/docs/ssr.md
+++ b/packages/docs/docs/ssr.md
@@ -61,7 +61,7 @@ const start = async () => {
const {assetsInfo} = await renderFrames({
config: composition,
// Path of the webpack bundle you have created
- webpackBundle: bundled,
+ serveUrl: bundled,
// Get's called after bundling is finished and the
// actual rendering starts.
onStart: () => console.log('Rendering frames...'),
@@ -104,6 +104,7 @@ const start = async () => {
pixelFormat: 'yuv420p',
// Information needed to construct audio correctly.
assetsInfo,
+ webpackBundle: bundled,
// Hook into the FFMPEG progress
onProgress: (frame) => undefined
});
diff --git a/packages/renderer/src/render.ts b/packages/renderer/src/render.ts
index a818539955..1bb00e163a 100644
--- a/packages/renderer/src/render.ts
+++ b/packages/renderer/src/render.ts
@@ -62,7 +62,7 @@ export const renderFrames = async ({
frameRange?: FrameRange | null;
serveUrl: string;
dumpBrowserLogs?: boolean;
- puppeteerInstance: PuppeteerBrowser;
+ puppeteerInstance?: PuppeteerBrowser;
onError?: (info: OnErrorInfo) => void;
}): Promise<RenderFramesOutput> => {
Internals.validateDimension(
@@ -91,6 +91,11 @@ export const renderFrames = async ({
const actualParallelism = getActualConcurrency(parallelism ?? null);
+ // TODO: Don't require it before launching lambda
+ if (!puppeteerInstance) {
+ throw new Error('no puppeteer');
+ }
+
const pages = new Array(actualParallelism).fill(true).map(async () => {
const page = await puppeteerInstance.newPage();
page.setViewport({