Skip to content

Commit 2de58cc

Browse files
committed
docs: Document from and durationInFrames on @remotion/media Video and Audio
Made-with: Cursor
1 parent 5d0d431 commit 2de58cc

File tree

2 files changed

+50
-0
lines changed

2 files changed

+50
-0
lines changed

packages/docs/docs/media/audio.mdx

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,31 @@ export const MyComposition = () => {
4747

4848
The URL of the audio to be rendered. Can be a remote URL or a local file referenced with [`staticFile()`](/docs/staticfile).
4949

50+
### `from?`<AvailableFrom v="4.0.445" />
51+
52+
At which frame this clip should start relative to the parent timeline. Default is `0`. Same meaning as [`from`](/docs/sequence#from) on [`<Sequence>`](/docs/sequence).
53+
54+
### `durationInFrames?`<AvailableFrom v="4.0.445" />
55+
56+
For how many frames the clip stays mounted. Default is `Infinity`. Same meaning as [`durationInFrames`](/docs/sequence#durationinframes) on [`<Sequence>`](/docs/sequence).
57+
58+
:::note
59+
You can still wrap `<Audio>` in an outer [`<Sequence>`](/docs/sequence). Timing [cascades](/docs/sequence#cascading) like nested sequences.
60+
:::
61+
62+
```tsx twoslash title="Clip starting at frame 30, lasting 90 frames"
63+
import {AbsoluteFill, staticFile} from 'remotion';
64+
import {Audio} from '@remotion/media';
65+
66+
export const MyComposition = () => {
67+
return (
68+
<AbsoluteFill>
69+
<Audio from={30} durationInFrames={90} src={staticFile('audio.mp3')} />
70+
</AbsoluteFill>
71+
);
72+
};
73+
```
74+
5075
### `trimBefore?`
5176

5277
Will remove a portion of the audio at the beginning (left side).

packages/docs/docs/media/video.mdx

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,31 @@ export const MyComposition = () => {
4949

5050
The URL of the video to be rendered. Can be a remote URL or a local file referenced with [`staticFile()`](/docs/staticfile).
5151

52+
### `from?`<AvailableFrom v="4.0.445" />
53+
54+
At which frame this clip should start relative to the parent timeline. Default is `0`. Same meaning as [`from`](/docs/sequence#from) on [`<Sequence>`](/docs/sequence).
55+
56+
### `durationInFrames?`<AvailableFrom v="4.0.445" />
57+
58+
For how many frames the clip stays mounted. Default is `Infinity`. Same meaning as [`durationInFrames`](/docs/sequence#durationinframes) on [`<Sequence>`](/docs/sequence).
59+
60+
:::note
61+
You can still wrap `<Video>` in an outer [`<Sequence>`](/docs/sequence). Timing [cascades](/docs/sequence#cascading) like nested sequences.
62+
:::
63+
64+
```tsx twoslash title="Clip starting at frame 30, lasting 90 frames"
65+
import {AbsoluteFill, staticFile} from 'remotion';
66+
import {Video} from '@remotion/media';
67+
68+
export const MyComposition = () => {
69+
return (
70+
<AbsoluteFill>
71+
<Video from={30} durationInFrames={90} src={staticFile('video.webm')} />
72+
</AbsoluteFill>
73+
);
74+
};
75+
```
76+
5277
### `trimBefore?`
5378

5479
Will remove a portion of the video at the beginning (left side).

0 commit comments

Comments
 (0)