Skip to content

🎥 Make videos programmatically with React

changed `endTo` prop name to `endAt`

Shankhadeep Deyace4c28ada15
diff --git a/packages/core/src/video/Video.tsx b/packages/core/src/video/Video.tsx
index 0bc4c37d43..f26facb5ec 100644
--- a/packages/core/src/video/Video.tsx
+++ b/packages/core/src/video/Video.tsx
@@ -6,16 +6,16 @@ import {VideoForRendering} from './VideoForRendering';
export const Video: React.FC<RemotionVideoProps & RemotionMainVideoProps> = ({
startAt,
- endTo,
+ endAt,
...props
}) => {
const startAtFrameNo = startAt ? startAt : 0;
- const endToFrameNO = endTo ? endTo : Infinity;
+ const endAtFrameNO = endAt ? endAt : Infinity;
if (process.env.NODE_ENV === 'development') {
return (
<Sequence
from={0 - startAtFrameNo}
- durationInFrames={endToFrameNO - startAtFrameNo}
+ durationInFrames={endAtFrameNO - startAtFrameNo}
>
<VideoForDevelopment {...props} />;
</Sequence>
@@ -24,7 +24,7 @@ export const Video: React.FC<RemotionVideoProps & RemotionMainVideoProps> = ({
return (
<Sequence
from={0 - startAtFrameNo}
- durationInFrames={endToFrameNO - startAtFrameNo}
+ durationInFrames={endAtFrameNO - startAtFrameNo}
>
<VideoForRendering {...props} />;
</Sequence>
diff --git a/packages/core/src/video/props.ts b/packages/core/src/video/props.ts
index e92a68c390..700f342d22 100644
--- a/packages/core/src/video/props.ts
+++ b/packages/core/src/video/props.ts
@@ -1,6 +1,6 @@
export type RemotionMainVideoProps = {
startAt?: number;
- endTo?: number;
+ endAt?: number;
};
export type RemotionVideoProps = Omit<
diff --git a/packages/docs/docs/video.md b/packages/docs/docs/video.md
index fac1726a28..39c36f8127 100644
--- a/packages/docs/docs/video.md
+++ b/packages/docs/docs/video.md
@@ -11,7 +11,7 @@ Videos with audio are not supported - yet! Audio will be muted in the final rend
## API / Example
-Use an import or require to load an video file and pass it as the `src` prop. All the props that the native `<video>` element accepts, `startAt` (optional) and `endTo` (optional) props (except `autoplay` and `controls`) will be forwarded (but of course not all are useful for Remotion). This means you can use all CSS to style the video.
+Use an import or require to load an video file and pass it as the `src` prop. All the props that the native `<video>` element accepts, `startAt` (optional) and `endAt` (optional) props (except `autoplay` and `controls`) will be forwarded (but of course not all are useful for Remotion). This means you can use all CSS to style the video.
```tsx
import {Video} from 'remotion';
@@ -24,7 +24,7 @@ export const MyVideo = () => {
<Video
src={video}
startAt={60} // if video is 30fps, then it will start at 2s
- endTo={120} // if video is 30fps, then it will end at 4s
+ endAt={120} // if video is 30fps, then it will end at 4s
style={{height: 1080 / 2, width: 1920 / 2}}
/>
</div>