mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-11-21 19:07:46 +01:00
Fix camera switching and loading position (#10982)
* Fix alignment * Set loading when switching cameras
This commit is contained in:
parent
d7ae0eedf8
commit
a823a18496
@ -89,7 +89,13 @@ export default function DynamicVideoPlayer({
|
|||||||
if (!isScrubbing) {
|
if (!isScrubbing) {
|
||||||
setLoadingTimeout(setTimeout(() => setIsLoading(true), 1000));
|
setLoadingTimeout(setTimeout(() => setIsLoading(true), 1000));
|
||||||
}
|
}
|
||||||
}, [isScrubbing]);
|
|
||||||
|
return () => {
|
||||||
|
if (loadingTimeout) {
|
||||||
|
clearTimeout(loadingTimeout)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, [camera, isScrubbing]);
|
||||||
|
|
||||||
const onPlayerLoaded = useCallback(() => {
|
const onPlayerLoaded = useCallback(() => {
|
||||||
if (!controller || !startTimestamp) {
|
if (!controller || !startTimestamp) {
|
||||||
@ -179,7 +185,7 @@ export default function DynamicVideoPlayer({
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
{isLoading && (
|
{isLoading && (
|
||||||
<ActivityIndicator className="absolute left-1/2 top-1/2 -translate-x1/2 -translate-y-1/2" />
|
<ActivityIndicator className="absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2" />
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user