Skip to content

🎥 Make videos programmatically with React

Merge branch 'main' into pr/128

Jonny Burger8f1982afb331
diff --cc packages/cli/src/editor/components/TimelineElements.tsx
index 922e5856f5,dfddb17d36..c01c1d1111
--- a/packages/cli/src/editor/components/TimelineElements.tsx
+++ b/packages/cli/src/editor/components/TimelineElements.tsx
@@@ -11,36 -11,22 +11,26 @@@ const Container = styled.div
grid-auto-rows: minmax(25px, 80px);
`;
- const Pre = styled.pre`
- color: white;
- font-family: Arial, Helvetica, sans-serif;
- font-size: 12px;
- margin-top: 0;
- margin-bottom: 0;
- padding: 5px;
- `;
-
- const SEQUENCE_GRADIENT = 'linear-gradient(to bottom, #3697e1, #348AC7 60%)';
- const AUDIO_GRADIENT = 'linear-gradient(rgb(16 171 58), rgb(43 165 63) 60%)';
-
export const TimelineElements: React.FC = () => {
- const {sequences} = useContext(Internals.CompositionManager);
+ const {sequences, assets} = useContext(Internals.CompositionManager);
const videoConfig = Internals.useUnsafeVideoConfig();
const timeline = useMemo((): Track[] => {
if (!videoConfig) {
return [];
}
- return calculateTimeline(sequences, videoConfig.durationInFrames);
- }, [sequences, videoConfig]);
+ return calculateTimeline({
+ assets,
+ sequences,
+ sequenceDuration: videoConfig.durationInFrames,
+ });
+ }, [assets, sequences, videoConfig]);
- // If a composition is 100 frames long, the last frame is 99
- // and therefore frame 99 should be at the right
- const lastFrame = (videoConfig?.durationInFrames ?? 1) - 1;
+ const inner: React.CSSProperties = useMemo(() => {
+ return {
+ height: 82,
+ };
+ }, []);
if (!videoConfig) {
return null;
diff --cc packages/core/src/internals.ts
index d0aa3ef10b,fc4589a3ad..1b790e4361
--- a/packages/core/src/internals.ts
+++ b/packages/core/src/internals.ts
@@@ -52,7 -51,7 +53,8 @@@ import * as perf from './perf'
import {getCompositionName, getIsEvaluation, getRoot} from './register-root';
import {RemotionRoot} from './RemotionRoot';
import * as Timeline from './timeline-position-state';
+ import {TimelineContextValue} from './timeline-position-state';
+import {truthy} from './truthy';
import {useUnsafeVideoConfig} from './use-unsafe-video-config';
import {useVideo} from './use-video';
@@@ -103,6 -102,5 +106,7 @@@ export type
TCompMetadata,
TSequence,
WebpackOverrideFn,
+ TAsset,
+ RenderAssetInfo,
+ TimelineContextValue,
};