diff --git a/web/src/components/Wrapper.tsx b/web/src/components/Wrapper.tsx index 0726d280e..860f41296 100644 --- a/web/src/components/Wrapper.tsx +++ b/web/src/components/Wrapper.tsx @@ -5,7 +5,7 @@ type TWrapperProps = { }; const Wrapper = ({ children }: TWrapperProps) => { - return
{children}
; + return
{children}
; }; export default Wrapper; diff --git a/web/src/components/player/DynamicVideoPlayer.tsx b/web/src/components/player/DynamicVideoPlayer.tsx index 1e099b383..77eb51ee8 100644 --- a/web/src/components/player/DynamicVideoPlayer.tsx +++ b/web/src/components/player/DynamicVideoPlayer.tsx @@ -99,26 +99,6 @@ export default function DynamicVideoPlayer({ // eslint-disable-next-line react-hooks/exhaustive-deps }, [controller]); - const [initPreviewOnly, setInitPreviewOnly] = useState(previewOnly); - - useEffect(() => { - if (!controller || !playerRef) { - return; - } - - if (previewOnly == initPreviewOnly) { - return; - } - - if (!previewOnly) { - controller.seekToTimestamp(playerRef.currentTime() || 0, true); - } - - setInitPreviewOnly(previewOnly); - // we only want to fire once when players are ready - // eslint-disable-next-line react-hooks/exhaustive-deps - }, [controller, previewOnly]); - // keyboard control const onKeyboardShortcut = useCallback( @@ -191,16 +171,23 @@ export default function DynamicVideoPlayer({ // start at correct time useEffect(() => { - if (previewOnly || !startTime) { - return; - } - const player = playerRef; if (!player) { return; } + if (previewOnly) { + player.autoplay(false); + return; + } + + player.autoplay(true); + + if (!startTime) { + return; + } + if (player.isReady_) { controller?.seekToTimestamp(startTime, true); return; diff --git a/web/src/views/events/RecordingView.tsx b/web/src/views/events/RecordingView.tsx index 123e7b74b..737caec82 100644 --- a/web/src/views/events/RecordingView.tsx +++ b/web/src/views/events/RecordingView.tsx @@ -373,7 +373,9 @@ export function MobileRecordingView({ - + {allCameras.map((cam) => ( - + {cam.replaceAll("_", " ")} ))} @@ -395,7 +401,7 @@ export function MobileRecordingView({