blakeblackshear.frigate/web/src/components/player/BirdseyeLivePlayer.tsx
Nicolas Mowen 2236ae5d3b Add jsmpeg support to new webUI and make birdseye default for live page (#8995)
* Add jsmpeg and make birdseye default for live view

* Fix jsmpeg

* Fix
2024-01-31 12:56:11 +00:00

37 lines
935 B
TypeScript

import WebRtcPlayer from "./WebRTCPlayer";
import { BirdseyeConfig } from "@/types/frigateConfig";
import ActivityIndicator from "../ui/activity-indicator";
import JSMpegPlayer from "./JSMpegPlayer";
type LivePlayerProps = {
birdseyeConfig: BirdseyeConfig;
liveMode: string;
};
export default function BirdseyeLivePlayer({
birdseyeConfig,
liveMode,
}: LivePlayerProps) {
if (liveMode == "webrtc") {
return (
<div className="max-w-5xl">
<WebRtcPlayer camera="birdseye" />
</div>
);
} else if (liveMode == "mse") {
return <div className="max-w-5xl">Not yet implemented</div>;
} else if (liveMode == "jsmpeg") {
return (
<div className={`max-w-[${birdseyeConfig.width}px]`}>
<JSMpegPlayer
camera="birdseye"
width={birdseyeConfig.width}
height={birdseyeConfig.height}
/>
</div>
);
} else {
<ActivityIndicator />;
}
}