diff --git a/web/src/components/player/JSMpegPlayer.tsx b/web/src/components/player/JSMpegPlayer.tsx index fd2a5382a..dc21d7d27 100644 --- a/web/src/components/player/JSMpegPlayer.tsx +++ b/web/src/components/player/JSMpegPlayer.tsx @@ -1,8 +1,9 @@ import { baseUrl } from "@/api/baseUrl"; import { useResizeObserver } from "@/hooks/resize-observer"; +import { cn } from "@/lib/utils"; // @ts-expect-error we know this doesn't have types import JSMpeg from "@cycjimmy/jsmpeg-player"; -import React, { useEffect, useMemo, useRef, useId } from "react"; +import React, { useEffect, useMemo, useRef, useId, useState } from "react"; type JSMpegPlayerProps = { className?: string; @@ -26,6 +27,7 @@ export default function JSMpegPlayer({ const videoRef = useRef(null); const internalContainerRef = useRef(null); const onPlayingRef = useRef(onPlaying); + const [showCanvas, setShowCanvas] = useState(false); const selectedContainerRef = useMemo( () => containerRef ?? internalContainerRef, @@ -101,6 +103,7 @@ export default function JSMpegPlayer({ audio: false, videoBufferSize: 1024 * 1024 * 4, onPlay: () => { + setShowCanvas(true); onPlayingRef.current?.(); }, }, @@ -110,7 +113,7 @@ export default function JSMpegPlayer({ return (
-
+
void; @@ -275,6 +276,16 @@ export default function LivePlayer({ />
+ {offline && !showStillWithoutActivity && ( +
+

+ {capitalizeFirstLetter(cameraConfig.name)} is offline +

+ +

No frames have been received, check error logs

+
+ )} +
{autoLive && !offline && @@ -282,7 +293,7 @@ export default function LivePlayer({ ((showStillWithoutActivity && !liveReady) || liveReady) && ( )} - {offline && ( + {offline && showStillWithoutActivity && ( diff --git a/web/src/pages/Live.tsx b/web/src/pages/Live.tsx index 5cee2c6ca..fc2a2bf8f 100644 --- a/web/src/pages/Live.tsx +++ b/web/src/pages/Live.tsx @@ -2,6 +2,7 @@ import { useFullscreen } from "@/hooks/use-fullscreen"; import { useHashState, usePersistedOverlayState, + useSearchEffect, } from "@/hooks/use-overlay-state"; import { FrigateConfig } from "@/types/frigateConfig"; import LiveBirdseyeView from "@/views/live/LiveBirdseyeView"; @@ -16,11 +17,21 @@ function Live() { // selection const [selectedCameraName, setSelectedCameraName] = useHashState(); - const [cameraGroup] = usePersistedOverlayState( + const [cameraGroup, setCameraGroup] = usePersistedOverlayState( "cameraGroup", "default" as string, ); + useSearchEffect("group", (cameraGroup) => { + if (config && cameraGroup) { + const group = config.camera_groups[cameraGroup]; + + if (group) { + setCameraGroup(cameraGroup); + } + } + }); + // fullscreen const mainRef = useRef(null);