mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-08 20:25:26 +03:00
use timestamp for end of timeline instead of duration
This commit is contained in:
parent
2dda228449
commit
a45c94eec0
@ -15,7 +15,7 @@ export type EventReviewTimelineProps = {
|
||||
segmentDuration: number;
|
||||
timestampSpread: number;
|
||||
timelineStart: number;
|
||||
timelineDuration?: number;
|
||||
timelineEnd: number;
|
||||
showHandlebar?: boolean;
|
||||
handlebarTime?: number;
|
||||
showMinimap?: boolean;
|
||||
@ -30,7 +30,7 @@ export function EventReviewTimeline({
|
||||
segmentDuration,
|
||||
timestampSpread,
|
||||
timelineStart,
|
||||
timelineDuration = 24 * 60 * 60,
|
||||
timelineEnd,
|
||||
showHandlebar = false,
|
||||
handlebarTime,
|
||||
showMinimap = false,
|
||||
@ -46,6 +46,10 @@ export function EventReviewTimeline({
|
||||
const timelineRef = useRef<HTMLDivElement>(null);
|
||||
const currentTimeRef = useRef<HTMLDivElement>(null);
|
||||
const observer = useRef<ResizeObserver | null>(null);
|
||||
const timelineDuration = useMemo(
|
||||
() => timelineEnd - timelineStart,
|
||||
[timelineEnd, timelineStart]
|
||||
);
|
||||
|
||||
const { alignDateToTimeline } = useEventUtils(events, segmentDuration);
|
||||
|
||||
|
||||
@ -188,7 +188,7 @@ function UIPlayground() {
|
||||
segmentDuration={60} // seconds per segment
|
||||
timestampSpread={15} // minutes between each major timestamp
|
||||
timelineStart={Math.floor(Date.now() / 1000)} // start of the timeline - all times are numeric, not Date objects
|
||||
timelineDuration={24 * 60 * 60} // in minutes, defaults to 24 hours
|
||||
timelineEnd={Math.floor(Date.now() / 1000) + 2 * 60 * 60} // end of timeline - timestamp
|
||||
showHandlebar // show / hide the handlebar
|
||||
handlebarTime={Math.floor(Date.now() / 1000) - 27 * 60} // set the time of the handlebar
|
||||
showMinimap // show / hide the minimap
|
||||
|
||||
Loading…
Reference in New Issue
Block a user