mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-08 12:15:25 +03:00
Fix available streaming modes
This commit is contained in:
parent
2ac3173b4a
commit
066fdc469c
@ -54,7 +54,6 @@ export default function DynamicCameraImage({
|
||||
if (eventIndex == -1) {
|
||||
const newActiveObjects = [...activeObjects, event.after.id];
|
||||
setActiveObjects(newActiveObjects);
|
||||
setKey(Date.now());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -48,7 +48,7 @@ function Live() {
|
||||
const defaultLiveMode = useMemo(() => {
|
||||
if (cameraConfig) {
|
||||
if (restreamEnabled) {
|
||||
return cameraConfig.ui.live_mode;
|
||||
return cameraConfig.ui.live_mode || config?.ui.live_mode;
|
||||
}
|
||||
|
||||
return "jsmpeg";
|
||||
@ -65,7 +65,8 @@ function Live() {
|
||||
<div className=" w-full">
|
||||
<div className="flex justify-between">
|
||||
<Heading as="h2">Live</Heading>
|
||||
<div>
|
||||
<div className="flex">
|
||||
<div className="mx-1">
|
||||
<DropdownMenu>
|
||||
<DropdownMenuTrigger asChild>
|
||||
<Button className="capitalize" variant="outline">
|
||||
@ -75,7 +76,15 @@ function Live() {
|
||||
<DropdownMenuContent>
|
||||
<DropdownMenuLabel>Select A Camera</DropdownMenuLabel>
|
||||
<DropdownMenuSeparator />
|
||||
<DropdownMenuRadioGroup value={camera} onValueChange={setCamera}>
|
||||
<DropdownMenuRadioGroup
|
||||
value={camera}
|
||||
onValueChange={setCamera}
|
||||
>
|
||||
{config?.birdseye.enabled && (
|
||||
<DropdownMenuRadioItem value="birdseye">
|
||||
Birdseye
|
||||
</DropdownMenuRadioItem>
|
||||
)}
|
||||
{sortedCameras.map((item) => (
|
||||
<DropdownMenuRadioItem
|
||||
className="capitalize"
|
||||
@ -88,6 +97,8 @@ function Live() {
|
||||
</DropdownMenuRadioGroup>
|
||||
</DropdownMenuContent>
|
||||
</DropdownMenu>
|
||||
</div>
|
||||
<div className="mx-1">
|
||||
<DropdownMenu>
|
||||
<DropdownMenuTrigger asChild>
|
||||
<Button className="capitalize" variant="outline">
|
||||
@ -101,21 +112,30 @@ function Live() {
|
||||
value={`${viewSource}`}
|
||||
onValueChange={setViewSource}
|
||||
>
|
||||
{restreamEnabled && (
|
||||
<DropdownMenuRadioItem value="webrtc">
|
||||
Webrtc
|
||||
</DropdownMenuRadioItem>
|
||||
<DropdownMenuRadioItem value="mse">MSE</DropdownMenuRadioItem>
|
||||
)}
|
||||
{restreamEnabled && (
|
||||
<DropdownMenuRadioItem value="mse">
|
||||
MSE
|
||||
</DropdownMenuRadioItem>
|
||||
)}
|
||||
<DropdownMenuRadioItem value="jsmpeg">
|
||||
Jsmpeg
|
||||
</DropdownMenuRadioItem>
|
||||
{camera != "birdseye" && (
|
||||
<DropdownMenuRadioItem value="debug">
|
||||
Debug
|
||||
</DropdownMenuRadioItem>
|
||||
)}
|
||||
</DropdownMenuRadioGroup>
|
||||
</DropdownMenuContent>
|
||||
</DropdownMenu>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{config && camera == "birdseye" && sourceIsLoaded && (
|
||||
<BirdseyeLivePlayer
|
||||
birdseyeConfig={config?.birdseye}
|
||||
|
||||
@ -16,7 +16,7 @@ export function getHourlyTimelineData(
|
||||
|
||||
// build a map of course to the types that are included in this hour
|
||||
// which allows us to know what items to keep depending on detail level
|
||||
const source_to_types: { [key: string]: string[] } = {};
|
||||
const sourceToTypes: { [key: string]: string[] } = {};
|
||||
let cardTypeStart: { [camera: string]: number } = {};
|
||||
Object.values(hourlyTimeline["hours"][hour]).forEach((i) => {
|
||||
if (i.timestamp > (cardTypeStart[i.camera] ?? 0) + GROUP_SECONDS) {
|
||||
@ -25,10 +25,10 @@ export function getHourlyTimelineData(
|
||||
|
||||
const groupKey = `${i.source_id}-${cardTypeStart[i.camera]}`;
|
||||
|
||||
if (groupKey in source_to_types) {
|
||||
source_to_types[groupKey].push(i.class_type);
|
||||
if (groupKey in sourceToTypes) {
|
||||
sourceToTypes[groupKey].push(i.class_type);
|
||||
} else {
|
||||
source_to_types[groupKey] = [i.class_type];
|
||||
sourceToTypes[groupKey] = [i.class_type];
|
||||
}
|
||||
});
|
||||
|
||||
@ -61,7 +61,7 @@ export function getHourlyTimelineData(
|
||||
let add = true;
|
||||
if (detailLevel == "normal") {
|
||||
if (
|
||||
source_to_types[sourceKey].length > 1 &&
|
||||
sourceToTypes[sourceKey].length > 1 &&
|
||||
["active", "attribute", "gone", "stationary", "visible"].includes(
|
||||
i.class_type
|
||||
)
|
||||
@ -70,8 +70,8 @@ export function getHourlyTimelineData(
|
||||
}
|
||||
} else if (detailLevel == "extra") {
|
||||
if (
|
||||
source_to_types[sourceKey].length > 1 &&
|
||||
i.class_type in ["attribute", "gone", "visible"]
|
||||
sourceToTypes[sourceKey].length > 1 &&
|
||||
["attribute", "gone", "visible"].includes(i.class_type)
|
||||
) {
|
||||
add = false;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user