🎥 Make videos programmatically with React
enable `pauseWhenBuffering` by default
Igor Samokhovets43bf3f92e0b2
diff --git a/packages/docs/docs/media/video.mdx b/packages/docs/docs/media/video.mdxindex 525effe26a..a611a249b8 100644--- a/packages/docs/docs/media/video.mdx+++ b/packages/docs/docs/media/video.mdx@@ -18,6 +18,8 @@ We recommend that you use [`<OffthreadVideo />`](/docs/offthreadvideo) for now.This component imports and displays a video, similar to [`<OffthreadVideo/>`](/docs/offthreadvideo) but during rendering, extracts the exact frame from the video using [Mediabunny](/docs/mediabunny) and displays it in a `<canvas>` tag.+This component has [native buffering support](/docs/player/buffer-state) enabled by default. When used in the Player, it automatically pauses playback when buffering and resumes when ready.+## Example```tsx twoslash@@ -205,10 +207,6 @@ Controls the `frame` which is returned when using the [`volume`](#volume) callbaCan be either `"repeat"` (default, start from 0 on each iteration) or `"extend"` (keep increasing frames).-### `pauseWhenBuffering?`--If set to `true` and the video is loading, the Player will enter into the [native buffering state](/docs/player/buffer-state). The default is `false`, but will become `true` in Remotion 5.0.-### `showInTimeline?`If set to `false`, no layer will be shown in the timeline of the Remotion Studio. The default is `true`.diff --git a/packages/media/src/video/props.ts b/packages/media/src/video/props.tsindex 7ac67c4d65..c4737a2711 100644--- a/packages/media/src/video/props.ts+++ b/packages/media/src/video/props.ts@@ -13,7 +13,6 @@ export type VideoProps = {volume?: VolumeProp;loopVolumeCurveBehavior?: LoopVolumeCurveBehavior;name?: string;- pauseWhenBuffering?: boolean;showInTimeline?: boolean;onVideoFrame?: OnVideoFrame;playbackRate?: number;diff --git a/packages/media/src/video/video.tsx b/packages/media/src/video/video.tsxindex 5bae8cfe70..ad4ce1b6b7 100644--- a/packages/media/src/video/video.tsx+++ b/packages/media/src/video/video.tsx@@ -10,15 +10,8 @@ const {validateMediaTrimProps, resolveTrimProps, validateMediaProps} =export const Video: React.FC<VideoProps> = (props) => {// Should only destruct `trimBefore` and `trimAfter` from props,// rest gets drilled down- const {- trimBefore,- trimAfter,- name,- pauseWhenBuffering,- stack,- showInTimeline,- ...otherProps- } = props;+ const {trimBefore, trimAfter, name, stack, showInTimeline, ...otherProps} =+ props;const environment = useRemotionEnvironment();if (typeof props.src !== 'string') {@@ -55,10 +48,7 @@ export const Video: React.FC<VideoProps> = (props) => {durationInFrames={trimAfterValue}name={name}>- <Video- pauseWhenBuffering={pauseWhenBuffering ?? false}- {...otherProps}- />+ <Video {...otherProps} /></Sequence>);}