Fix android/chrome seeking on previews (#10512)

This commit is contained in:
Nicolas Mowen
2024-03-17 18:53:47 -06:00
committed by GitHub
parent bb6f153e2e
commit 880bae1eb2
4 changed files with 47 additions and 19 deletions

View File

@@ -616,6 +616,8 @@ function MotionReview({
[selectedRangeIdx, timeRangeSegments],
);
const [scrubbing, setScrubbing] = useState(false);
// move to next clip
useEffect(() => {
@@ -670,6 +672,7 @@ function MotionReview({
timeRange={currentTimeRange}
startTime={startTime}
cameraPreviews={relevantPreviews || []}
isScrubbing={scrubbing}
onControllerReady={(controller) => {
videoPlayersRef.current[camera.name] = controller;
}}
@@ -694,6 +697,7 @@ function MotionReview({
motion_events={motionData ?? []}
severityType="significant_motion"
contentRef={contentRef}
onHandlebarDraggingChange={(scrubbing) => setScrubbing(scrubbing)}
/>
</div>
</>

View File

@@ -192,7 +192,7 @@ export function RecordingView({
const grow = useMemo(() => {
if (mainCameraAspect == "wide") {
return "w-full aspect-wide";
} else if (mainCameraAspect == "tall") {
} else if (isDesktop && mainCameraAspect == "tall") {
return "h-full aspect-tall";
} else {
return "w-full aspect-video";
@@ -288,6 +288,7 @@ export function RecordingView({
timeRange={currentTimeRange}
cameraPreviews={allPreviews ?? []}
startTime={startTime}
isScrubbing={scrubbing}
onControllerReady={(controller) => {
previewRefs.current[cam] = controller;
controller.scrubToTimestamp(startTime);