Skip to content

🎥 Make videos programmatically with React

Fix premount/postmount timeline indicators for Video and Audio components in Remotion Studio

Igor Samokhovets897eafdfbd7a
diff --git a/packages/core/src/Sequence.tsx b/packages/core/src/Sequence.tsx
index 7fd5ef5bfc..91a03a12e7 100644
--- a/packages/core/src/Sequence.tsx
+++ b/packages/core/src/Sequence.tsx
@@ -183,6 +183,8 @@ const RegularSequenceRefForwardingFunction: React.ForwardRefRenderFunction<
width: width ?? parentSequence?.width ?? null,
premounting,
postmounting,
+ premountDisplay: premountDisplay ?? null,
+ postmountDisplay: postmountDisplay ?? null,
};
}, [
cumulatedFrom,
@@ -194,6 +196,8 @@ const RegularSequenceRefForwardingFunction: React.ForwardRefRenderFunction<
width,
premounting,
postmounting,
+ premountDisplay,
+ postmountDisplay,
]);
const timelineClipName = useMemo(() => {
diff --git a/packages/core/src/SequenceContext.tsx b/packages/core/src/SequenceContext.tsx
index d2d79d3bd2..b4761e1e93 100644
--- a/packages/core/src/SequenceContext.tsx
+++ b/packages/core/src/SequenceContext.tsx
@@ -12,4 +12,6 @@ export type SequenceContextType = {
height: number | null;
premounting: boolean;
postmounting: boolean;
+ premountDisplay: number | null;
+ postmountDisplay: number | null;
};
diff --git a/packages/core/src/audio/AudioForPreview.tsx b/packages/core/src/audio/AudioForPreview.tsx
index 48c7ad2779..4101a2437c 100644
--- a/packages/core/src/audio/AudioForPreview.tsx
+++ b/packages/core/src/audio/AudioForPreview.tsx
@@ -185,8 +185,8 @@ const AudioForDevelopmentForwardRefFunction: React.ForwardRefRenderFunction<
id: timelineId,
stack: _remotionInternalStack,
showInTimeline,
- premountDisplay: null,
- postmountDisplay: null,
+ premountDisplay: sequenceContext?.premountDisplay ?? null,
+ postmountDisplay: sequenceContext?.postmountDisplay ?? null,
onAutoPlayError: null,
isPremounting: Boolean(sequenceContext?.premounting),
isPostmounting: Boolean(sequenceContext?.postmounting),
diff --git a/packages/core/src/video/VideoForPreview.tsx b/packages/core/src/video/VideoForPreview.tsx
index 4d73bb73e9..c26fe6e39b 100644
--- a/packages/core/src/video/VideoForPreview.tsx
+++ b/packages/core/src/video/VideoForPreview.tsx
@@ -145,8 +145,8 @@ const VideoForDevelopmentRefForwardingFunction: React.ForwardRefRenderFunction<
id: timelineId,
stack: _remotionInternalStack,
showInTimeline,
- premountDisplay: null,
- postmountDisplay: null,
+ premountDisplay: parentSequence?.premountDisplay ?? null,
+ postmountDisplay: parentSequence?.postmountDisplay ?? null,
onAutoPlayError: onAutoPlayError ?? null,
isPremounting: Boolean(parentSequence?.premounting),
isPostmounting: Boolean(parentSequence?.postmounting),