Chapter 224: <OffthreadVideo>
Core Idea
This component imports and displays a video, similar to <Html5Video/>, but during rendering, extracts the exact frame from the video and displays it in a <Img> tag. This extraction process happens outside the browser using FFmpeg.
Key Concepts
- Example
- Props
- src
- trimBefore?<AvailableFrom v="4.0.319"/>
- trimAfter?<AvailableFrom v="4.0.319"/>
startFrom?
endAt?
- transparent?<AvailableFrom v="4.0.0" />
Code Examples
export const MyVideo = () => {
return (
<AbsoluteFill>
<OffthreadVideo src={staticFile('video.webm')} />
</AbsoluteFill>
);
};
- What it demonstrates: Usage pattern for
<OffthreadVideo> from the official docs.
Key Takeaways
- Understand example when working with
<OffthreadVideo>.
- Understand props when working with
<OffthreadVideo>.
- Understand src when working with
<OffthreadVideo>.
- Understand trimbefore?<availablefrom v="4.0.319"/> when working with
<OffthreadVideo>.
- Understand trimafter?<availablefrom v="4.0.319"/> when working with
<OffthreadVideo>.
Connects To
- Animatedimage: related page in the Assets & Media section.
- Delaying: related page in the Assets & Media section.
- Exporting: related page in the Assets & Media section.