getRenderProgress()v4.0.469
warning
Experimental package: We reserve the right to make breaking changes in order to correct bad design decisions until this notice is gone.
Polls the progress of a detached renderMediaOnVercel() call.
Use this API when your Vercel function should start a render and return before the video has finished rendering.
Example
app/api/render/progress/route.tsimport {getRenderProgress } from '@remotion/vercel'; export async functionGET (req :Request ) { consturl = newURL (req .url ); constsandboxId =url .searchParams .get ('sandboxId'); constcmdId =url .searchParams .get ('cmdId'); if (!sandboxId || !cmdId ) { returnResponse .json ({error : 'Missing params'}, {status : 400}); } constprogress = awaitgetRenderProgress ({sandboxId ,cmdId }); returnResponse .json (progress ); }
Arguments
An object with the following properties:
sandboxId
The ID returned from renderMediaOnVercel({detached: true}).
cmdId
The command ID returned from renderMediaOnVercel({detached: true}).
Return value
A RenderProgress object.
Terminal stages are:
done: The render was uploaded to Vercel Blob.error: The render failed.expired: The sandbox no longer exists.
When done or error is returned, remove the stored render handle in your app.
The sandbox is left alive until its configured timeout so a refreshed page can still read the terminal progress.