Skip to content

🎥 Make videos programmatically with React

buffering

Jonny Burger11ddaade4423
diff --git a/packages/docs/docs/audio.md b/packages/docs/docs/audio.md
index 8b85f856c9..b29a188db2 100644
--- a/packages/docs/docs/audio.md
+++ b/packages/docs/docs/audio.md
@@ -148,6 +148,10 @@ In the [Remotion Studio](/docs/terminology/studio) or in the [Remotion Player](/
Make values for [`volume`](#volume) greater than `1` result in amplification during renders.
In the Remotion Studio, the volume will be limited to `1`, since the browser cannot amplify audio.
+### `pauseWhenBuffering`<AvailableFrom v="4.0.100"/>
+
+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.
+
## See also
- [Source code for this component](https://github.com/remotion-dev/remotion/blob/main/packages/core/src/audio/Audio.tsx)
diff --git a/packages/docs/docs/offthreadvideo.md b/packages/docs/docs/offthreadvideo.md
index b287619a1c..db3df12ee2 100644
--- a/packages/docs/docs/offthreadvideo.md
+++ b/packages/docs/docs/offthreadvideo.md
@@ -195,6 +195,10 @@ Accepts a number between `0.01` and `2`, where `1` represents the original pitch
A `toneFrequency` of 0.5 would lower the pitch by half, and a `toneFrequency` of `1.5` would increase the pitch by 50%.
+### `pauseWhenBuffering`<AvailableFrom v="4.0.100"/>
+
+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.
+
### ~~`imageFormat` <AvailableFrom v="3.0.22" />~~
_removed in v4.0.0_
diff --git a/packages/docs/docs/player/buffer-state.mdx b/packages/docs/docs/player/buffer-state.mdx
index 723dfe56d5..fd59014421 100644
--- a/packages/docs/docs/player/buffer-state.mdx
+++ b/packages/docs/docs/player/buffer-state.mdx
@@ -16,7 +16,7 @@ Remotion has a native buffer state, which can be used to pause the video when th
### Activating the buffer state
-A component can tell the player to switch into a buffer state by first using the `useBufferState()` hook and then calling `buffer.delayPlayback()`:
+A component can tell the player to switch into a buffer state by first using the [`useBufferState()`](/docs/use-buffer-state) hook and then calling `buffer.delayPlayback()`:
```tsx twoslash title="MyComp.tsx"
import React from "react";
@@ -135,12 +135,10 @@ const MyComp: React.FC = () => {
You can enable buffering on the following components:
-- [`<Audio>`](/docs/audio)
-- [`<Video>`](/docs/video)
-- [`<OffthreadVideo>`](/docs/offthreadvideo)
-- [`<Img>`](/docs/img)
-
-// FIXME: How?
+- [`<Audio>`](/docs/audio) - add the `pauseWhenBuffering` props
+- [`<Video>`](/docs/video) - add the `pauseWhenBuffering` props
+- [`<OffthreadVideo>`](/docs/offthreadvideo) - add the `pauseWhenBuffering` props
+- [`<Img>`](/docs/img) // FIXME: How?
### Listening to buffer events
@@ -221,6 +219,6 @@ You may add additional UI to this, for example by overlaying the player with a s
## Upcoming changes in future versions
-In Remotion 4.0, media tags such as `<Video>` and `<Audio>` will need to opt-in to use the buffer state.
+In Remotion 4.0, media tags such as `<Audio>`, `<OffthreadVideo>` tags will need to opt-in to use the buffer state.
-In Remotion 5.0, media tags will automatically use the buffer state, but they can opt out of it.
+In Remotion 5.0, it is planned that `<Audio>`, `<Video>` and `<OffthreadVideo>` will automatically use the buffer state, but they can opt out of it.
diff --git a/packages/docs/docs/video.md b/packages/docs/docs/video.md
index 48774e1d81..2f32e7458c 100644
--- a/packages/docs/docs/video.md
+++ b/packages/docs/docs/video.md
@@ -212,6 +212,10 @@ A `toneFrequency` of 0.5 would lower the pitch by half, and a `toneFrequency` of
Handle an error playing the video. From v3.3.89, if you pass an `onError` callback, then no exception will be thrown. Previously, the error could not be caught.
+### `pauseWhenBuffering`<AvailableFrom v="4.0.100"/>
+
+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.
+
## Speed up renders for video with silent audio
Remotion will download the whole video during render in order to mix its audio. If the video contains a silent audio track, you can add the muted property to signal to Remotion that it does not need to download the video and make the render more efficient.