diff --git a/web/src/components/overlay/detail/TrackingDetails.tsx b/web/src/components/overlay/detail/TrackingDetails.tsx index 0cd8a0d13..727dd4552 100644 --- a/web/src/components/overlay/detail/TrackingDetails.tsx +++ b/web/src/components/overlay/detail/TrackingDetails.tsx @@ -56,6 +56,7 @@ export function TrackingDetails({ const apiHost = useApiHost(); const imgRef = useRef(null); const [imgLoaded, setImgLoaded] = useState(false); + const [isVideoLoading, setIsVideoLoading] = useState(true); const [displaySource, _setDisplaySource] = useState<"video" | "image">( "video", ); @@ -70,6 +71,10 @@ export function TrackingDetails({ (event.start_time ?? 0) + annotationOffset / 1000 - REVIEW_PADDING, ); + useEffect(() => { + setIsVideoLoading(true); + }, [event.id]); + const { data: eventSequence } = useSWR([ "timeline", { @@ -527,22 +532,28 @@ export function TrackingDetails({ )} > {displaySource == "video" && ( - + <> + setIsVideoLoading(false)} + isDetailMode={true} + camera={event.camera} + currentTimeOverride={currentTime} + /> + {isVideoLoading && ( + + )} + )} {displaySource == "image" && ( <> diff --git a/web/src/components/player/HlsVideoPlayer.tsx b/web/src/components/player/HlsVideoPlayer.tsx index 20d3dd4d7..27daecf97 100644 --- a/web/src/components/player/HlsVideoPlayer.tsx +++ b/web/src/components/player/HlsVideoPlayer.tsx @@ -130,6 +130,8 @@ export default function HlsVideoPlayer({ return; } + setLoadedMetadata(false); + const currentPlaybackRate = videoRef.current.playbackRate; if (!useHlsCompat) {