Skip to content

🎥 Make videos programmatically with React

fix media shortcut props

Jonny Burgerda70cd436f1a
diff --git a/packages/core/src/audio/Audio.tsx b/packages/core/src/audio/Audio.tsx
index 4501ee4a24..fd797ce0fb 100644
--- a/packages/core/src/audio/Audio.tsx
+++ b/packages/core/src/audio/Audio.tsx
@@ -13,8 +13,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 b9c5781534..8a9c8ab47e 100644
--- a/packages/core/src/video/Video.tsx
+++ b/packages/core/src/video/Video.tsx
@@ -15,8 +15,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>
);
}