From fa22f01f3938f86cad859485aa3c4535140d3496 Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Mon, 11 Mar 2024 17:07:56 -0500 Subject: [PATCH] use flexbox for recordings view (#10385) --- web/src/views/events/RecordingView.tsx | 153 +++++++++++++------------ 1 file changed, 79 insertions(+), 74 deletions(-) diff --git a/web/src/views/events/RecordingView.tsx b/web/src/views/events/RecordingView.tsx index 857c5de04..1df198913 100644 --- a/web/src/views/events/RecordingView.tsx +++ b/web/src/views/events/RecordingView.tsx @@ -172,88 +172,93 @@ export function DesktopRecordingView({ Back -
- {allCameras.map((cam) => { - if (cam == mainCamera) { - return ( -
- { - videoPlayersRef.current[cam] = controller; - controller.onPlayerTimeUpdate((timestamp: number) => { - setCurrentTime(timestamp); - - allCameras.forEach((otherCam) => { - if (cam != otherCam) { - videoPlayersRef.current[otherCam]?.scrubToTimestamp( - Math.floor(timestamp), - ); - } - }); - }); - }} - /> -
- ); - } - - return ( -
+
+
+
+
{ - videoPlayersRef.current[cam] = controller; - controller.scrubToTimestamp(startTime, true); + videoPlayersRef.current[mainCamera] = controller; + controller.onPlayerTimeUpdate((timestamp: number) => { + setCurrentTime(timestamp); + + allCameras.forEach((otherCam) => { + if (mainCamera != otherCam) { + videoPlayersRef.current[otherCam]?.scrubToTimestamp( + Math.floor(timestamp), + ); + } + }); + }); }} - onClick={() => onSelectCamera(cam)} />
- ); - })} -
+
+ {allCameras.map((cam) => { + if (cam !== mainCamera) { + return ( +
+ { + videoPlayersRef.current[cam] = controller; + controller.scrubToTimestamp(startTime, true); + }} + onClick={() => onSelectCamera(cam)} + /> +
+ ); + } + return null; + })} +
+
+
-
- {severity != "significant_motion" ? ( - setScrubbing(scrubbing)} - /> - ) : ( - setScrubbing(scrubbing)} - /> - )} +
+ {severity != "significant_motion" ? ( + setScrubbing(scrubbing)} + /> + ) : ( + setScrubbing(scrubbing)} + /> + )} +
);