Skip to content

🎥 Make videos programmatically with React

introduce a _remotionDebugSeeking prop

Jonny Burger1c67e0d18bd4
diff --git a/packages/core/src/audio/Audio.tsx b/packages/core/src/audio/Audio.tsx
index b9d80ea44d..bcbc191748 100644
--- a/packages/core/src/audio/Audio.tsx
+++ b/packages/core/src/audio/Audio.tsx
@@ -35,6 +35,7 @@ const AudioRefForwardingFunction: React.ForwardRefRenderFunction<
stack,
pauseWhenBuffering,
showInTimeline,
+ _remotionDebugSeeking,
...otherProps
} = props;
const {loop, ...propsOtherThanLoop} = props;
@@ -146,6 +147,7 @@ const AudioRefForwardingFunction: React.ForwardRefRenderFunction<
_remotionInternalNativeLoopPassed={
props._remotionInternalNativeLoopPassed ?? false
}
+ _remotionDebugSeeking={_remotionDebugSeeking ?? false}
_remotionInternalStack={stack ?? null}
shouldPreMountAudioTags={
audioContext !== null && audioContext.numberOfAudioTags > 0
diff --git a/packages/core/src/audio/AudioForPreview.tsx b/packages/core/src/audio/AudioForPreview.tsx
index 37b4add1d7..07bb92514b 100644
--- a/packages/core/src/audio/AudioForPreview.tsx
+++ b/packages/core/src/audio/AudioForPreview.tsx
@@ -33,6 +33,7 @@ type AudioForPreviewProps = RemotionAudioProps & {
readonly pauseWhenBuffering: boolean;
readonly _remotionInternalNativeLoopPassed: boolean;
readonly _remotionInternalStack: string | null;
+ readonly _remotionDebugSeeking: boolean;
readonly showInTimeline: boolean;
readonly stack?: string | undefined;
};
@@ -61,6 +62,7 @@ const AudioForDevelopmentForwardRefFunction: React.ForwardRefRenderFunction<
_remotionInternalNeedsDurationCalculation,
_remotionInternalNativeLoopPassed,
_remotionInternalStack,
+ _remotionDebugSeeking,
allowAmplificationDuringRender,
name,
pauseWhenBuffering,
@@ -170,6 +172,7 @@ const AudioForDevelopmentForwardRefFunction: React.ForwardRefRenderFunction<
acceptableTimeShiftInSeconds ?? DEFAULT_ACCEPTABLE_TIMESHIFT,
isPremounting: Boolean(sequenceContext?.premounting),
pauseWhenBuffering,
+ debugSeeking: _remotionDebugSeeking,
});
useImperativeHandle(
diff --git a/packages/core/src/audio/props.ts b/packages/core/src/audio/props.ts
index 3671e4c18a..c396b8eb92 100644
--- a/packages/core/src/audio/props.ts
+++ b/packages/core/src/audio/props.ts
@@ -20,6 +20,7 @@ export type RemotionAudioProps = Omit<
allowAmplificationDuringRender?: boolean;
_remotionInternalNeedsDurationCalculation?: boolean;
_remotionInternalNativeLoopPassed?: boolean;
+ _remotionDebugSeeking?: boolean;
toneFrequency?: number;
pauseWhenBuffering?: boolean;
showInTimeline?: boolean;
diff --git a/packages/core/src/video/OffthreadVideo.tsx b/packages/core/src/video/OffthreadVideo.tsx
index 688af60730..3e815e4f09 100644
--- a/packages/core/src/video/OffthreadVideo.tsx
+++ b/packages/core/src/video/OffthreadVideo.tsx
@@ -68,12 +68,18 @@ export const OffthreadVideo: React.FC<OffthreadVideoProps> = (props) => {
return <OffthreadVideoForRendering {...otherProps} />;
}
- const {transparent, toneMapped, ...withoutTransparent} = otherProps;
+ const {
+ transparent,
+ toneMapped,
+ _remotionDebugSeeking,
+ ...withoutTransparent
+ } = otherProps;
return (
<VideoForPreview
_remotionInternalStack={stack ?? null}
_remotionInternalNativeLoopPassed={false}
+ _remotionDebugSeeking={_remotionDebugSeeking ?? false}
onDuration={onDuration}
onlyWarnForMediaSeekingError
pauseWhenBuffering={pauseWhenBuffering ?? false}
diff --git a/packages/core/src/video/Video.tsx b/packages/core/src/video/Video.tsx
index 415173991e..164165d9d1 100644
--- a/packages/core/src/video/Video.tsx
+++ b/packages/core/src/video/Video.tsx
@@ -35,7 +35,7 @@ const VideoForwardingFunction: React.ForwardRefRenderFunction<
showInTimeline,
...otherProps
} = props;
- const {loop, ...propsOtherThanLoop} = props;
+ const {loop, _remotionDebugSeeking, ...propsOtherThanLoop} = props;
const {fps} = useVideoConfig();
const environment = getRemotionEnvironment();
@@ -131,6 +131,7 @@ const VideoForwardingFunction: React.ForwardRefRenderFunction<
_remotionInternalNativeLoopPassed={
_remotionInternalNativeLoopPassed ?? false
}
+ _remotionDebugSeeking={_remotionDebugSeeking ?? false}
showInTimeline={showInTimeline ?? true}
/>
);
diff --git a/packages/core/src/video/VideoForPreview.tsx b/packages/core/src/video/VideoForPreview.tsx
index 08583daaa0..1566497984 100644
--- a/packages/core/src/video/VideoForPreview.tsx
+++ b/packages/core/src/video/VideoForPreview.tsx
@@ -32,6 +32,7 @@ type VideoForPreviewProps = RemotionVideoProps & {
readonly pauseWhenBuffering: boolean;
readonly _remotionInternalNativeLoopPassed: boolean;
readonly _remotionInternalStack: string | null;
+ readonly _remotionDebugSeeking: boolean;
readonly showInTimeline: boolean;
};
@@ -55,6 +56,7 @@ const VideoForDevelopmentRefForwardingFunction: React.ForwardRefRenderFunction<
name,
_remotionInternalNativeLoopPassed,
_remotionInternalStack,
+ _remotionDebugSeeking,
style,
pauseWhenBuffering,
showInTimeline,
@@ -115,6 +117,7 @@ const VideoForDevelopmentRefForwardingFunction: React.ForwardRefRenderFunction<
acceptableTimeShiftInSeconds ?? DEFAULT_ACCEPTABLE_TIMESHIFT,
isPremounting: Boolean(parentSequence?.premounting),
pauseWhenBuffering,
+ debugSeeking: _remotionDebugSeeking,
});
const actualFrom = parentSequence ? parentSequence.relativeFrom : 0;
diff --git a/packages/core/src/video/props.ts b/packages/core/src/video/props.ts
index 087dfbb8cc..8323d45a34 100644
--- a/packages/core/src/video/props.ts
+++ b/packages/core/src/video/props.ts
@@ -9,6 +9,7 @@ export type RemotionMainVideoProps = {
* @deprecated Only for internal `transparent` use
*/
_remotionInternalNativeLoopPassed?: boolean;
+ _remotionDebugSeeking?: boolean;
};
export type RemotionVideoProps = Omit<