mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-10 05:05:26 +03:00
Fix seeking
This commit is contained in:
parent
6f86fe13ed
commit
db40177868
@ -353,7 +353,7 @@ function PreviewFramesPlayer({
|
|||||||
|
|
||||||
return previewFrames.map((frame) =>
|
return previewFrames.map((frame) =>
|
||||||
// @ts-expect-error we know this item will exist
|
// @ts-expect-error we know this item will exist
|
||||||
parseFloat(frame.split("-").slice(undefined, -5)),
|
parseFloat(frame.split("-").at(-1).slice(undefined, -5)),
|
||||||
);
|
);
|
||||||
}, [previewFrames]);
|
}, [previewFrames]);
|
||||||
|
|
||||||
|
|||||||
@ -500,7 +500,7 @@ function VideoPreview({
|
|||||||
</video>
|
</video>
|
||||||
<Slider
|
<Slider
|
||||||
ref={sliderRef}
|
ref={sliderRef}
|
||||||
className="absolute inset-x-0 bottom-0 z-30 pointer-events-none"
|
className="absolute inset-x-0 bottom-0 z-30"
|
||||||
value={[progress]}
|
value={[progress]}
|
||||||
onValueChange={onManualSeek}
|
onValueChange={onManualSeek}
|
||||||
onValueCommit={onStopManualSeek}
|
onValueCommit={onStopManualSeek}
|
||||||
|
|||||||
@ -811,7 +811,17 @@ function MotionReview({
|
|||||||
isPlaying={playing}
|
isPlaying={playing}
|
||||||
onPlayPause={setPlaying}
|
onPlayPause={setPlaying}
|
||||||
onSeek={(diff) => {
|
onSeek={(diff) => {
|
||||||
|
const wasPlaying = playing;
|
||||||
|
|
||||||
|
if (wasPlaying) {
|
||||||
|
setPlaying(false);
|
||||||
|
}
|
||||||
|
|
||||||
setCurrentTime(currentTime + diff);
|
setCurrentTime(currentTime + diff);
|
||||||
|
|
||||||
|
if (wasPlaying) {
|
||||||
|
setTimeout(() => setPlaying(true), 100);
|
||||||
|
}
|
||||||
}}
|
}}
|
||||||
show={currentTime < timeRange.before - 4}
|
show={currentTime < timeRange.before - 4}
|
||||||
/>
|
/>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user