diff --git a/web/src/components/TimelineSummary.jsx b/web/src/components/TimelineSummary.jsx
index 829197c91..7947406c8 100644
--- a/web/src/components/TimelineSummary.jsx
+++ b/web/src/components/TimelineSummary.jsx
@@ -9,9 +9,11 @@ import { Zone } from '../icons/Zone';
import { useState } from 'preact/hooks';
import { useApiHost } from '../api';
import Button from './Button';
+import VideoPlayer from './VideoPlayer';
export default function TimelineSummary({ event }) {
const apiHost = useApiHost();
+ const eventDuration = event.end_time - event.start_time;
const { data: eventTimeline } = useSWR([
'timeline',
{
@@ -23,6 +25,16 @@ export default function TimelineSummary({ event }) {
const [timeIndex, setTimeIndex] = useState(0);
+ const onSelectMoment = async (index) => {
+ setTimeIndex(index);
+
+ if (this.player) {
+ const videoOffset = this.player.duration() - eventDuration;
+ const startTime = videoOffset + (eventTimeline[index].timestamp - event.start_time);
+ this.player.currentTime(startTime);
+ }
+ };
+
if (!eventTimeline || !config) {
return
-