Skip to content

🎥 Make videos programmatically with React

remotion: Deprecate trimAfter on legacy media

JonnyBurger0812eb4cebe7
diff --git a/packages/core/src/audio/props.ts b/packages/core/src/audio/props.ts
index 7bf1d00d95..bcab14ff92 100644
--- a/packages/core/src/audio/props.ts
+++ b/packages/core/src/audio/props.ts
@@ -16,6 +16,7 @@ export type RemotionMainAudioProps = {
trimBefore?: number;
/**
* Trim of the audio from the right (end) in frames.
+ * @deprecated Wrap the component in a `<Sequence>` and use `durationInFrames` instead. See https://github.com/remotion-dev/remotion/pull/11685
*/
trimAfter?: number;
};
diff --git a/packages/core/src/video/props.ts b/packages/core/src/video/props.ts
index ad125a91a9..b1f60738bc 100644
--- a/packages/core/src/video/props.ts
+++ b/packages/core/src/video/props.ts
@@ -17,6 +17,7 @@ export type CommonVideoProps = {
trimBefore: number | undefined;
/**
* Trim of the video from the right (end) in frames.
+ * @deprecated Wrap the component in a `<Sequence>` and use `durationInFrames` instead. See https://github.com/remotion-dev/remotion/pull/11685
*/
trimAfter: number | undefined;
/**
diff --git a/packages/docs/docs/html5-audio.mdx b/packages/docs/docs/html5-audio.mdx
index 88704a45ab..d6f3799b83 100644
--- a/packages/docs/docs/html5-audio.mdx
+++ b/packages/docs/docs/html5-audio.mdx
@@ -69,12 +69,9 @@ Controls the `frame` which is returned when using the [`volume`](#volume) callba
Can be either `"repeat"` (default, start from 0 on each iteration) or `"extend"` (keep increasing frames).
-### `trimBefore?` / `trimAfter?`<AvailableFrom v="4.0.319"/>
+### `trimBefore?`<AvailableFrom v="4.0.319"/>
-`<Html5Audio>` has two helper props you can use to trim audio:
-
-- `trimBefore` will remove a portion of the audio at the beginning (left side)
-- `trimAfter` will remove a portion of the audio at the end (right side)
+Removes a portion of the audio at the beginning (left side).
In the following example, we assume that the [`fps`](/docs/composition#fps) of the composition is `30`.
@@ -97,10 +94,18 @@ export const MyVideo = () => {
};
```
+### ~~`trimAfter?`~~<AvailableFrom v="4.0.319"/>
+
+:::info Deprecated
+Wrap the component in a [`<Sequence>`](/docs/sequence) and use [`durationInFrames`](/docs/sequence#durationinframes) instead. See [PR #11685](https://github.com/remotion-dev/remotion/pull/11685).
+:::
+
+Removes a portion of the audio at the end (right side).
+
### ~~`startFrom?` / `endAt?`~~
:::info Deprecated
-These props have been renamed to [`trimBefore`](#trimbefore--trimafter) and [`trimAfter`](#trimbefore--trimafter) in 4.0.319. They will continue to work but you cannot use them together with the new props.
+These props have been renamed to [`trimBefore`](#trimbefore) and [`trimAfter`](#trimafter) in 4.0.319. They will continue to work but you cannot use them together with the new props.
:::
### `playbackRate?`<AvailableFrom v="2.2.0"/>
diff --git a/packages/docs/docs/html5-video.mdx b/packages/docs/docs/html5-video.mdx
index 84af17d370..7ed1b4cb89 100644
--- a/packages/docs/docs/html5-video.mdx
+++ b/packages/docs/docs/html5-video.mdx
@@ -83,7 +83,11 @@ export const MyComposition = () => {
};
```
-### `trimAfter?`<AvailableFrom v="4.0.319"/>
+### ~~`trimAfter?`~~<AvailableFrom v="4.0.319"/>
+
+:::info Deprecated
+Wrap the component in a [`<Sequence>`](/docs/sequence) and use [`durationInFrames`](/docs/sequence#durationinframes) instead. See [PR #11685](https://github.com/remotion-dev/remotion/pull/11685).
+:::
Removes a portion of the video at the end (right side). See [`trimBefore`](#trimbefore) for an explanation.
diff --git a/packages/docs/docs/offthreadvideo.mdx b/packages/docs/docs/offthreadvideo.mdx
index 132ade758f..45692ee4dc 100644
--- a/packages/docs/docs/offthreadvideo.mdx
+++ b/packages/docs/docs/offthreadvideo.mdx
@@ -79,7 +79,11 @@ export const MyComposition = () => {
};
```
-### `trimAfter?`<AvailableFrom v="4.0.319"/>
+### ~~`trimAfter?`~~<AvailableFrom v="4.0.319"/>
+
+:::info Deprecated
+Wrap the component in a [`<Sequence>`](/docs/sequence) and use [`durationInFrames`](/docs/sequence#durationinframes) instead. See [PR #11685](https://github.com/remotion-dev/remotion/pull/11685).
+:::
Removes a portion of the video at the end (right side). See [`trimBefore`](/docs/offthreadvideo#trimbefore) for an explanation.