mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-11-21 19:07:46 +01:00
Fix safari preview transition (#10638)
This commit is contained in:
parent
e3a7aa6b6c
commit
d260c6926a
@ -12,7 +12,7 @@ import { Preview } from "@/types/preview";
|
|||||||
import { PreviewPlayback } from "@/types/playback";
|
import { PreviewPlayback } from "@/types/playback";
|
||||||
import { isCurrentHour } from "@/utils/dateUtil";
|
import { isCurrentHour } from "@/utils/dateUtil";
|
||||||
import { baseUrl } from "@/api/baseUrl";
|
import { baseUrl } from "@/api/baseUrl";
|
||||||
import { isAndroid, isChrome, isMobile } from "react-device-detect";
|
import { isAndroid, isChrome, isMobile, isSafari } from "react-device-detect";
|
||||||
import { Skeleton } from "../ui/skeleton";
|
import { Skeleton } from "../ui/skeleton";
|
||||||
|
|
||||||
type PreviewPlayerProps = {
|
type PreviewPlayerProps = {
|
||||||
@ -223,7 +223,11 @@ function PreviewVideoPlayer({
|
|||||||
setHasCanvas(true);
|
setHasCanvas(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
previewRef.current.load();
|
if (isSafari) {
|
||||||
|
setTimeout(() => previewRef.current?.load(), 100);
|
||||||
|
} else {
|
||||||
|
previewRef.current.load();
|
||||||
|
}
|
||||||
// we only want this to change when current preview changes
|
// we only want this to change when current preview changes
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
}, [currentPreview, previewRef]);
|
}, [currentPreview, previewRef]);
|
||||||
|
Loading…
Reference in New Issue
Block a user