轻客户端
以下方法和类型可以从 @remotion/lambda/client 导入。
🌐 The following methods and types can be imported from @remotion/lambda/client.
@remotion/lambda/client 重新导出了 @remotion/lambda-client NPM 包中的所有内容,如果你的项目中只需要这些功能,你可以安装 @remotion/lambda-client,从而节省一些依赖。
import {
renderMediaOnLambda ,
renderStillOnLambda ,
getRenderProgress ,
getCompositionsOnLambda ,
getFunctions ,
AwsRegion ,
RenderProgress ,
validateWebhookSignature ,
WebhookPayload ,
presignUrl ,
PresignUrlInput ,
getSites ,
speculateFunctionName ,
CustomCredentials , // available from v4.0.60
getAwsClient , // available from v4.0.82
deleteRender , // available from v4.0.84
DeleteRenderInput , // available from v4.0.84
} from '@remotion/lambda/client';getServiceClient() 从 v4.0.60 到 v4.0.81 错误地包含在内。请改用 getAwsClient()。
这些函数不依赖于我们的渲染器,并且可以例如与 ESBuild 或 Webpack 一起打包(例如在 Next.js 中就是这种情况)。
🌐 These functions don't have any dependencies on our renderer and can be bundled for example with ESBuild or Webpack (like is the case for example in Next.js).
目前不支持在边缘框架(Vercel Edge、Cloudflare Workers)上导入轻客户端。
🌐 Importing the light client on edge frameworks (Vercel Edge, Cloudflare Workers) is currently not supported.
我们不建议直接从浏览器调用这些函数,因为这样会泄露你的 AWS 凭证。
相反,这个轻量客户端旨在减少打包包大小,并在你从另一个 Lambda 函数调用 Remotion Lambda API 时避免出现问题,因此需要打包你的函数代码。
🌐 Instead, this light client is meant to reduce the bundle size and avoid problems if you are calling Remotion Lambda APIs from another Lambda function and therefore need to bundle your function code.
通常,Next.JS 无服务器端点或类似的端点在底层使用 AWS Lambda 函数,可以使用 @remotion/lambda/client。
🌐 Commonly, Next.JS serverless endpoints or similar use AWS Lambda functions under the hood, for which @remotion/lambda/client can be used.