Skip to content

🎥 Make videos programmatically with React

actual threshold

Jonny Burger2ffce1581c0f
diff --git a/packages/core/src/sequencing/index.tsx b/packages/core/src/sequencing/index.tsx
index 44418a059b..452d4b975b 100644
--- a/packages/core/src/sequencing/index.tsx
+++ b/packages/core/src/sequencing/index.tsx
@@ -89,13 +89,17 @@ export const Sequence: React.FC<{
const endThreshold = (() => {
if (FEATURE_FLAG_V2_BREAKING_CHANGES) {
- return absoluteFrame > actualFrom + durationInFrames - 1;
+ return actualFrom + durationInFrames - 1;
}
- return absoluteFrame > actualFrom + durationInFrames;
+ return actualFrom + durationInFrames;
})();
const content =
- absoluteFrame < actualFrom ? null : endThreshold ? null : children;
+ absoluteFrame < actualFrom
+ ? null
+ : absoluteFrame > endThreshold
+ ? null
+ : children;
return (
<SequenceContext.Provider value={contextValue}>
diff --git a/packages/core/src/video/VideoForDevelopment.tsx b/packages/core/src/video/VideoForDevelopment.tsx
index 049b947f9f..88b4e3c0df 100644
--- a/packages/core/src/video/VideoForDevelopment.tsx
+++ b/packages/core/src/video/VideoForDevelopment.tsx
@@ -1,4 +1,4 @@
-import React, {useEffect, useRef, useState} from 'react';
+import React, {useEffect, useRef} from 'react';
import {usePlayingState} from '../timeline-position-state';
import {useAbsoluteCurrentFrame, useCurrentFrame} from '../use-frame';
import {useUnsafeVideoConfig} from '../use-unsafe-video-config';
@@ -11,8 +11,6 @@ export const VideoForDevelopment: React.FC<RemotionVideoProps> = (props) => {
const videoConfig = useUnsafeVideoConfig();
const [playing] = usePlayingState();
- const [videoDuration, setVideoDuration] = useState(0);
-
useEffect(() => {
if (playing) {
videoRef.current?.play();