mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-08 20:25:26 +03:00
Load after current preview changes
This commit is contained in:
parent
53638cac9e
commit
ce538db892
@ -104,11 +104,6 @@ export default function PreviewVideoPlayer({
|
||||
Math.floor(preview.end) <= timeRange.end,
|
||||
);
|
||||
setCurrentPreview(preview);
|
||||
|
||||
if (preview && previewRef.current) {
|
||||
previewRef.current.load();
|
||||
}
|
||||
|
||||
controller.newPlayback({
|
||||
preview,
|
||||
timeRange,
|
||||
@ -118,6 +113,14 @@ export default function PreviewVideoPlayer({
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [controller, timeRange]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!currentPreview || !previewRef.current) {
|
||||
return;
|
||||
}
|
||||
|
||||
previewRef.current.load();
|
||||
}, [currentPreview, previewRef]);
|
||||
|
||||
return (
|
||||
<div
|
||||
className={`relative ${className ?? ""} ${onClick ? "cursor-pointer" : ""}`}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user