mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-09 12:45:25 +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,
|
Math.floor(preview.end) <= timeRange.end,
|
||||||
);
|
);
|
||||||
setCurrentPreview(preview);
|
setCurrentPreview(preview);
|
||||||
|
|
||||||
if (preview && previewRef.current) {
|
|
||||||
previewRef.current.load();
|
|
||||||
}
|
|
||||||
|
|
||||||
controller.newPlayback({
|
controller.newPlayback({
|
||||||
preview,
|
preview,
|
||||||
timeRange,
|
timeRange,
|
||||||
@ -118,6 +113,14 @@ export default function PreviewVideoPlayer({
|
|||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
}, [controller, timeRange]);
|
}, [controller, timeRange]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (!currentPreview || !previewRef.current) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
previewRef.current.load();
|
||||||
|
}, [currentPreview, previewRef]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={`relative ${className ?? ""} ${onClick ? "cursor-pointer" : ""}`}
|
className={`relative ${className ?? ""} ${onClick ? "cursor-pointer" : ""}`}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user