@remotion/player
使用 Remotion 播放器,你可以在任何 React 应用中嵌入 Remotion 视频,并在运行时自定义视频内容。
🌐 Using the Remotion Player you can embed Remotion videos in any React app and customize the video content at runtime.
演示
🌐 Demo
播放视频,然后调整视频下方的参数。
🌐 Play the video, then tweak the parameters below the video.
Enter your name:
Select your favorite color:
查看此示例的源代码。
🌐 See the source code for this example.
模板
🌐 Templates
以下模板包含播放器和 Lambda 渲染,是构建视频应用的良好起点:
🌐 The following templates include the Player and Lambda rendering and are a good starting point for building a video app:
- Next.js(应用目录)
- Next.js(应用目录,无 TailwindCSS)
- Next.js(页面目录)
- Next.js(应用目录,在 Vercel Sandbox 中渲染而非 Lambda)
- React Router 7 (Remix)
应用编程接口
🌐 API
指南
🌐 Guide
Installation
Install the Player into your project
Examples
Code samples for various scenarios
Sizing
Setting the size of the Player
Autoplay
Dealing with browser autoplay policies
Display time
Write a custom component for displaying the current time
Preloading assets
Make assets ready to play when they appear in the video
Best practices
Checklist of correct implementation
Buffer state
Pause the Player while assets are loading
Avoiding flickers
Troubleshooting for flickers due to unloaded assets
Premounting
Mount components earlier to allow them to load
Drag & Drop
Allow interactivity on the canvas
Custom controls
Recipes for custom Play buttons, volume sliders, etc.
Media Keys
Control what happens when users presses ⏯️
另请参阅
🌐 See also