Skip to content

🎥 Make videos programmatically with React

fix media shortcut props

Jonny Burger8f23dbfa7d25
diff --git a/packages/core/src/audio/Audio.tsx b/packages/core/src/audio/Audio.tsx
index 9cda3e4a7a..96ad6cb640 100644
--- a/packages/core/src/audio/Audio.tsx
+++ b/packages/core/src/audio/Audio.tsx
@@ -15,8 +15,13 @@ export const Audio: React.FC<RemotionAudioProps & RemotionMainAudioProps> = (
const startAtFrameNo = startAt ?? 0;
const endAtFrameNo = endAt ?? Infinity;
return (
- <Sequence from={0 - startAtFrameNo} durationInFrames={endAtFrameNo}>
- <Audio {...otherProps} />
+ <Sequence
+ from={startAtFrameNo}
+ durationInFrames={endAtFrameNo - startAtFrameNo}
+ >
+ <Sequence from={0 - startAtFrameNo} durationInFrames={Infinity}>
+ <Audio {...otherProps} />
+ </Sequence>
</Sequence>
);
}
diff --git a/packages/core/src/video/Video.tsx b/packages/core/src/video/Video.tsx
index 6d4ecfafe2..fe0749229a 100644
--- a/packages/core/src/video/Video.tsx
+++ b/packages/core/src/video/Video.tsx
@@ -16,8 +16,13 @@ export const Video: React.FC<RemotionVideoProps & RemotionMainVideoProps> = (
const startAtFrameNo = startAt ?? 0;
const endAtFrameNo = endAt ?? Infinity;
return (
- <Sequence from={0 - startAtFrameNo} durationInFrames={endAtFrameNo}>
- <Video {...otherProps} />
+ <Sequence
+ from={startAtFrameNo}
+ durationInFrames={endAtFrameNo - startAtFrameNo}
+ >
+ <Sequence from={0 - startAtFrameNo} durationInFrames={Infinity}>
+ <Video {...otherProps} />
+ </Sequence>
</Sequence>
);
}