initial try

This commit is contained in:
Josh Hawkins 2024-03-11 15:14:35 -05:00
parent 8d4b9bc7ed
commit 921cb23f82
5 changed files with 27 additions and 7 deletions

View File

@ -39,6 +39,7 @@ export default function BirdseyeLivePlayer({
<div className={`max-w-[${birdseyeConfig.width}px]`}> <div className={`max-w-[${birdseyeConfig.width}px]`}>
<JSMpegPlayer <JSMpegPlayer
camera="birdseye" camera="birdseye"
className="w-full flex justify-center rounded-2xl overflow-hidden"
width={birdseyeConfig.width} width={birdseyeConfig.width}
height={birdseyeConfig.height} height={birdseyeConfig.height}
/> />

View File

@ -18,9 +18,16 @@ function Live() {
if (cameraGroup) { if (cameraGroup) {
const group = config.camera_groups[cameraGroup]; const group = config.camera_groups[cameraGroup];
return Object.values(config.cameras) console.log(config.cameras);
const groupCameras = Object.values(config.cameras)
.filter((conf) => conf.enabled && group.cameras.includes(conf.name)) .filter((conf) => conf.enabled && group.cameras.includes(conf.name))
.sort((aConf, bConf) => aConf.ui.order - bConf.ui.order); .sort((aConf, bConf) => aConf.ui.order - bConf.ui.order);
if (group.cameras.includes("birdseye")) {
groupCameras.push({
name: "birdseye",
});
}
return groupCameras;
} }
return Object.values(config.cameras) return Object.values(config.cameras)

View File

@ -22,6 +22,7 @@ import {
SelectTrigger, SelectTrigger,
SelectValue, SelectValue,
} from "@/components/ui/select"; } from "@/components/ui/select";
import BirdseyeLivePlayer from "@/components/player/BirdseyeLivePlayer";
// Color data // Color data
const colors = [ const colors = [
@ -184,6 +185,8 @@ function UIPlayground() {
}; };
const [isEventsReviewTimeline, setIsEventsReviewTimeline] = useState(true); const [isEventsReviewTimeline, setIsEventsReviewTimeline] = useState(true);
const birdseyeConfig = config?.birdseye;
console.log(birdseyeConfig);
return ( return (
<> <>
@ -243,6 +246,14 @@ function UIPlayground() {
<div className="w-[40px] my-4"> <div className="w-[40px] my-4">
<CameraActivityIndicator /> <CameraActivityIndicator />
</div> </div>
<div className="">
{birdseyeConfig && (
<BirdseyeLivePlayer
birdseyeConfig={birdseyeConfig}
liveMode={birdseyeConfig.restream ? "mse" : "jsmpeg"}
/>
)}
</div>
<p> <p>
<Button onClick={handleZoomOut} disabled={zoomLevel === 0}> <Button onClick={handleZoomOut} disabled={zoomLevel === 0}>
Zoom Out Zoom Out

View File

@ -133,6 +133,7 @@ export default function LiveDashboardView({
} else { } else {
grow = "aspect-video"; grow = "aspect-video";
} }
// console.log(camera.name);
return ( return (
<LivePlayer <LivePlayer
key={camera.name} key={camera.name}

View File

@ -12,24 +12,24 @@ export default defineConfig({
server: { server: {
proxy: { proxy: {
"/api": { "/api": {
target: "http://localhost:5000", target: "http://192.168.5.4:5000",
ws: true, ws: true,
}, },
"/vod": { "/vod": {
target: "http://localhost:5000", target: "http://192.168.5.4:5000",
}, },
"/clips": { "/clips": {
target: "http://localhost:5000", target: "http://192.168.5.4:5000",
}, },
"/exports": { "/exports": {
target: "http://localhost:5000", target: "http://192.168.5.4:5000",
}, },
"/ws": { "/ws": {
target: "ws://localhost:5000", target: "ws://192.168.5.4:5000",
ws: true, ws: true,
}, },
"/live": { "/live": {
target: "ws://localhost:5000", target: "ws://192.168.5.4:5000",
changeOrigin: true, changeOrigin: true,
ws: true, ws: true,
}, },