diff --git a/web/src/components/filter/CameraGroupSelector.tsx b/web/src/components/filter/CameraGroupSelector.tsx index b36406e4d..326ce7946 100644 --- a/web/src/components/filter/CameraGroupSelector.tsx +++ b/web/src/components/filter/CameraGroupSelector.tsx @@ -146,6 +146,8 @@ function NewGroupDialog({ open, setOpen, currentGroups }: NewGroupDialogProps) { const { data: config, mutate: updateConfig } = useSWR("config"); + const birdseyeConfig = useMemo(() => config?.birdseye, [config]); + // add fields const [editState, setEditState] = useState<"none" | "add" | "edit">("none"); @@ -298,7 +300,10 @@ function NewGroupDialog({ open, setOpen, currentGroups }: NewGroupDialogProps) { - {Object.keys(config?.cameras ?? {}).map((camera) => ( + {[ + ...(birdseyeConfig?.enabled ? ["birdseye"] : []), + ...Object.keys(config?.cameras ?? {}), + ].map((camera) => ( - - + player = ( + ); } else if (liveMode == "mse") { if ("MediaSource" in window || "ManagedMediaSource" in window) { - return ( -
- -
+ player = ( + ); } else { - return ( + player = (
MSE is only supported on iOS 17.1+. You'll need to update if available or use jsmpeg / webRTC streams. See the docs for more info. @@ -35,16 +32,23 @@ export default function BirdseyeLivePlayer({ ); } } else if (liveMode == "jsmpeg") { - return ( -
- -
+ player = ( + ); } else { - ; + player = ; } + + return ( +
+
+
+
{player}
+
+ ); } diff --git a/web/src/pages/Live.tsx b/web/src/pages/Live.tsx index 848283eb0..2233c29cd 100644 --- a/web/src/pages/Live.tsx +++ b/web/src/pages/Live.tsx @@ -11,6 +11,14 @@ function Live() { const [selectedCameraName, setSelectedCameraName] = useOverlayState("camera"); const [cameraGroup] = useOverlayState("cameraGroup"); + const includesBirdseye = useMemo(() => { + if (config && cameraGroup) { + return config.camera_groups[cameraGroup].cameras.includes("birdseye"); + } else { + return false; + } + }, [config, cameraGroup]); + const cameras = useMemo(() => { if (!config) { return []; @@ -40,6 +48,7 @@ function Live() { return ( ); diff --git a/web/src/pages/UIPlayground.tsx b/web/src/pages/UIPlayground.tsx index be8531e4e..76ac6fe95 100644 --- a/web/src/pages/UIPlayground.tsx +++ b/web/src/pages/UIPlayground.tsx @@ -22,6 +22,7 @@ import { SelectTrigger, SelectValue, } from "@/components/ui/select"; +import BirdseyeLivePlayer from "@/components/player/BirdseyeLivePlayer"; // Color data const colors = [ @@ -184,6 +185,7 @@ function UIPlayground() { }; const [isEventsReviewTimeline, setIsEventsReviewTimeline] = useState(true); + const birdseyeConfig = config?.birdseye; return ( <> @@ -243,6 +245,14 @@ function UIPlayground() {
+
+ {birdseyeConfig && ( + + )} +