mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-11-21 19:07:46 +01:00
Motion review improvements (#10833)
* render skeleton for preview player until motion data is loaded * skeleton for timeline
This commit is contained in:
parent
42559fa55d
commit
466a9104e5
@ -42,6 +42,7 @@ import VideoControls from "@/components/player/VideoControls";
|
||||
import { TimeRange } from "@/types/timeline";
|
||||
import { useCameraMotionNextTimestamp } from "@/hooks/use-camera-activity";
|
||||
import useOptimisticState from "@/hooks/use-optimistic-state";
|
||||
import { Skeleton } from "@/components/ui/skeleton";
|
||||
|
||||
type EventViewProps = {
|
||||
reviews?: ReviewSegment[];
|
||||
@ -837,6 +838,7 @@ function MotionReview({
|
||||
const detectionType = getDetectionType(camera.name);
|
||||
return (
|
||||
<div key={camera.name} className={`relative ${spans}`}>
|
||||
{motionData ? (
|
||||
<PreviewPlayer
|
||||
key={camera.name}
|
||||
className={`rounded-2xl ${spans} ${grow}`}
|
||||
@ -851,11 +853,14 @@ function MotionReview({
|
||||
onClick={() =>
|
||||
onOpenRecording({
|
||||
camera: camera.name,
|
||||
startTime: Math.min(currentTime, Date.now() / 1000 - 10),
|
||||
startTime: currentTime,
|
||||
severity: "significant_motion",
|
||||
})
|
||||
}
|
||||
/>
|
||||
) : (
|
||||
<Skeleton className={`rounded-2xl ${spans} ${grow}`} />
|
||||
)}
|
||||
<div
|
||||
className={`review-item-ring pointer-events-none z-10 absolute rounded-lg inset-0 size-full -outline-offset-[2.8px] outline outline-[3px] ${detectionType ? `outline-severity_${detectionType} shadow-severity_${detectionType}` : "outline-transparent duration-500"}`}
|
||||
/>
|
||||
@ -865,6 +870,7 @@ function MotionReview({
|
||||
</div>
|
||||
</div>
|
||||
<div className="w-[55px] md:w-[100px] overflow-y-auto no-scrollbar">
|
||||
{motionData ? (
|
||||
<MotionReviewTimeline
|
||||
segmentDuration={segmentDuration}
|
||||
timestampSpread={15}
|
||||
@ -887,6 +893,9 @@ function MotionReview({
|
||||
}}
|
||||
dense={isMobile}
|
||||
/>
|
||||
) : (
|
||||
<Skeleton className="rounded-2xl size-full" />
|
||||
)}
|
||||
</div>
|
||||
|
||||
<VideoControls
|
||||
|
Loading…
Reference in New Issue
Block a user