mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-07-13 23:41:15 +03:00
fix preview playback rate for motion previews
This commit is contained in:
parent
25087007d6
commit
74f60ae92e
@ -348,6 +348,19 @@ function MotionPreviewClip({
|
|||||||
}
|
}
|
||||||
}, [clipStart, clipEnd, playbackRate, preview]);
|
}, [clipStart, clipEnd, playbackRate, preview]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (!videoRef.current || !preview || !videoPlaying) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isSafari || (isFirefox && isMobile)) {
|
||||||
|
// These browsers step frames manually; rebuild the interval at the new rate
|
||||||
|
resetPlayback();
|
||||||
|
} else {
|
||||||
|
videoRef.current.playbackRate = playbackRate;
|
||||||
|
}
|
||||||
|
}, [playbackRate, preview, videoPlaying, resetPlayback]);
|
||||||
|
|
||||||
const drawDimOverlay = useCallback(() => {
|
const drawDimOverlay = useCallback(() => {
|
||||||
if (!dimOverlayCanvasRef.current) {
|
if (!dimOverlayCanvasRef.current) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user