Add on click from main dashboard

This commit is contained in:
Nicolas Mowen 2024-03-15 14:19:15 -06:00
parent 2ae7835590
commit a199569b8a
2 changed files with 4 additions and 0 deletions

View File

@ -9,12 +9,14 @@ type LivePlayerProps = {
className?: string; className?: string;
birdseyeConfig: BirdseyeConfig; birdseyeConfig: BirdseyeConfig;
liveMode: LivePlayerMode; liveMode: LivePlayerMode;
onClick?: () => void;
}; };
export default function BirdseyeLivePlayer({ export default function BirdseyeLivePlayer({
className, className,
birdseyeConfig, birdseyeConfig,
liveMode, liveMode,
onClick,
}: LivePlayerProps) { }: LivePlayerProps) {
let player; let player;
if (liveMode == "webrtc") { if (liveMode == "webrtc") {
@ -50,6 +52,7 @@ export default function BirdseyeLivePlayer({
return ( return (
<div <div
className={`relative flex justify-center w-full cursor-pointer ${className ?? ""}`} className={`relative flex justify-center w-full cursor-pointer ${className ?? ""}`}
onClick={onClick}
> >
<div className="absolute top-0 inset-x-0 rounded-2xl z-10 w-full h-[30%] bg-gradient-to-b from-black/20 to-transparent pointer-events-none"></div> <div className="absolute top-0 inset-x-0 rounded-2xl z-10 w-full h-[30%] bg-gradient-to-b from-black/20 to-transparent pointer-events-none"></div>
<div className="absolute bottom-0 inset-x-0 rounded-2xl z-10 w-full h-[10%] bg-gradient-to-t from-black/20 to-transparent pointer-events-none"></div> <div className="absolute bottom-0 inset-x-0 rounded-2xl z-10 w-full h-[10%] bg-gradient-to-t from-black/20 to-transparent pointer-events-none"></div>

View File

@ -134,6 +134,7 @@ export default function LiveDashboardView({
<BirdseyeLivePlayer <BirdseyeLivePlayer
birdseyeConfig={birdseyeConfig} birdseyeConfig={birdseyeConfig}
liveMode={birdseyeConfig.restream ? "mse" : "jsmpeg"} liveMode={birdseyeConfig.restream ? "mse" : "jsmpeg"}
onClick={() => onSelectCamera("birdseye")}
/> />
)} )}
{cameras.map((camera) => { {cameras.map((camera) => {