diff --git a/web/src/components/player/DynamicVideoPlayer.tsx b/web/src/components/player/DynamicVideoPlayer.tsx index c1bfbaddc..910c8cc79 100644 --- a/web/src/components/player/DynamicVideoPlayer.tsx +++ b/web/src/components/player/DynamicVideoPlayer.tsx @@ -38,11 +38,6 @@ export default function DynamicVideoPlayer({ }: DynamicVideoPlayerProps) { const apiHost = useApiHost(); const { data: config } = useSWR("config"); - const timezone = useMemo( - () => - config?.ui?.timezone || Intl.DateTimeFormat().resolvedOptions().timeZone, - [config], - ); // playback behavior const wideVideo = useMemo(() => { @@ -152,14 +147,8 @@ export default function DynamicVideoPlayer({ // initial state const initialPlaybackSource = useMemo(() => { - const date = new Date(timeRange.start * 1000); return { - src: `${apiHost}vod/${date.getFullYear()}-${ - date.getMonth() + 1 - }/${date.getDate()}/${date.getHours()}/${camera}/${timezone.replaceAll( - "/", - ",", - )}/master.m3u8`, + src: `${apiHost}vod/${camera}/start/${timeRange.start}/end/${timeRange.end}/master.m3u8`, type: "application/vnd.apple.mpegurl", }; // we only want to calculate this once @@ -222,13 +211,7 @@ export default function DynamicVideoPlayer({ return; } - const date = new Date(timeRange.start * 1000); - const playbackUri = `${apiHost}vod/${date.getFullYear()}-${ - date.getMonth() + 1 - }/${date.getDate()}/${date.getHours()}/${camera}/${timezone.replaceAll( - "/", - ",", - )}/master.m3u8`; + const playbackUri = `${apiHost}vod/${camera}/start/${timeRange.start}/end/${timeRange.end}/master.m3u8`; controller.newPlayback({ recordings: recordings ?? [], @@ -436,7 +419,7 @@ export class DynamicVideoController { const scrubResult = this.previewController.scrubToTimestamp(time); if (!scrubResult && saveIfNotReady) { - //this.previewController.setNewPreviewStartTime(time); + this.previewController.setNewPreviewStartTime(time); } if (scrubResult && this.playerMode != "scrubbing") { diff --git a/web/src/views/events/RecordingView.tsx b/web/src/views/events/RecordingView.tsx index 1df198913..fc294029e 100644 --- a/web/src/views/events/RecordingView.tsx +++ b/web/src/views/events/RecordingView.tsx @@ -11,6 +11,7 @@ import { DropdownMenuRadioItem, DropdownMenuTrigger, } from "@/components/ui/dropdown-menu"; +import { FrigateConfig } from "@/types/frigateConfig"; import { Preview } from "@/types/preview"; import { MotionData, ReviewSegment, ReviewSeverity } from "@/types/review"; import { getChunkedTimeDay } from "@/utils/timelineUtil"; @@ -37,6 +38,7 @@ export function DesktopRecordingView({ allCameras, allPreviews, }: DesktopRecordingViewProps) { + const { data: config } = useSWR("config"); const navigate = useNavigate(); const contentRef = useRef(null); @@ -162,6 +164,21 @@ export function DesktopRecordingView({ : null, ); + const grow = useMemo(() => { + if (!config) { + return "aspect-video"; + } + + const aspectRatio = + config.cameras[mainCamera].detect.width / + config.cameras[mainCamera].detect.height; + if (aspectRatio > 2) { + return "aspect-wide"; + } else { + return "aspect-video"; + } + }, [config, mainCamera]); + return (