Skip to content

🎥 Make videos programmatically with React

Merge branch 'main' into pr/128

Jonny Burgerd894f81ce376
diff --cc packages/core/src/audio/Audio.tsx
index 6e16c45a40,4501ee4a24..5443830cb2
--- a/packages/core/src/audio/Audio.tsx
+++ b/packages/core/src/audio/Audio.tsx
@@@ -1,9 -1,23 +1,24 @@@
import React from 'react';
+ import {Sequence} from '../sequencing';
+ import {validateStartFromProps} from '../validate-start-from-props';
import {AudioForDevelopment} from './AudioForDevelopment';
+import {AudioForRendering} from './AudioForRendering';
- import {RemotionAudioProps} from './props';
+ import {RemotionAudioProps, RemotionMainAudioProps} from './props';
- export const Audio: React.FC<RemotionAudioProps> = (props) => {
+ export const Audio: React.FC<RemotionAudioProps & RemotionMainAudioProps> = (
+ props
+ ) => {
+ const {startAt, endAt, ...otherProps} = props;
+ if (typeof startAt !== 'undefined' || typeof endAt !== 'undefined') {
+ validateStartFromProps(startAt, endAt);
+ const startAtFrameNo = startAt ?? 0;
+ const endAtFrameNo = endAt ?? Infinity;
+ return (
+ <Sequence from={0 - startAtFrameNo} durationInFrames={endAtFrameNo}>
+ <Audio {...otherProps} />
+ </Sequence>
+ );
+ }
if (process.env.NODE_ENV === 'development') {
return <AudioForDevelopment {...props} />;
}