mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-11 05:35:25 +03:00
motion video controls handle current time better
This commit is contained in:
parent
2e63941598
commit
aea4e77d69
@ -805,6 +805,11 @@ function MotionReview({
|
||||
return;
|
||||
}
|
||||
|
||||
if (nextTimestamp >= timeRange.before - 4) {
|
||||
setPlaying(false);
|
||||
return;
|
||||
}
|
||||
|
||||
const handleTimeout = () => {
|
||||
setCurrentTime(nextTimestamp);
|
||||
timeoutIdRef.current = setTimeout(handleTimeout, 500 / playbackRate);
|
||||
@ -818,7 +823,7 @@ function MotionReview({
|
||||
}
|
||||
};
|
||||
}
|
||||
}, [playing, playbackRate, nextTimestamp]);
|
||||
}, [playing, playbackRate, nextTimestamp, setPlaying, timeRange]);
|
||||
|
||||
const { alignStartDateToTimeline } = useTimelineUtils({
|
||||
segmentDuration,
|
||||
@ -962,7 +967,6 @@ function MotionReview({
|
||||
)}
|
||||
</div>
|
||||
|
||||
{!scrubbing && (
|
||||
<VideoControls
|
||||
className="absolute bottom-16 left-1/2 -translate-x-1/2 bg-secondary"
|
||||
features={{
|
||||
@ -971,6 +975,7 @@ function MotionReview({
|
||||
playbackRate: true,
|
||||
}}
|
||||
isPlaying={playing}
|
||||
show={!scrubbing}
|
||||
playbackRates={[4, 8, 12, 16]}
|
||||
playbackRate={playbackRate}
|
||||
controlsOpen={controlsOpen}
|
||||
@ -990,9 +995,7 @@ function MotionReview({
|
||||
}
|
||||
}}
|
||||
onSetPlaybackRate={setPlaybackRate}
|
||||
show={currentTime < timeRange.before - 4}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user