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) {
|
if (eventIndex == -1) {
|
||||||
const newActiveObjects = [...activeObjects, event.after.id];
|
const newActiveObjects = [...activeObjects, event.after.id];
|
||||||
setActiveObjects(newActiveObjects);
|
setActiveObjects(newActiveObjects);
|
||||||
setKey(Date.now());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -48,7 +48,7 @@ function Live() {
|
|||||||
const defaultLiveMode = useMemo(() => {
|
const defaultLiveMode = useMemo(() => {
|
||||||
if (cameraConfig) {
|
if (cameraConfig) {
|
||||||
if (restreamEnabled) {
|
if (restreamEnabled) {
|
||||||
return cameraConfig.ui.live_mode;
|
return cameraConfig.ui.live_mode || config?.ui.live_mode;
|
||||||
}
|
}
|
||||||
|
|
||||||
return "jsmpeg";
|
return "jsmpeg";
|
||||||
@ -65,55 +65,75 @@ function Live() {
|
|||||||
<div className=" w-full">
|
<div className=" w-full">
|
||||||
<div className="flex justify-between">
|
<div className="flex justify-between">
|
||||||
<Heading as="h2">Live</Heading>
|
<Heading as="h2">Live</Heading>
|
||||||
<div>
|
<div className="flex">
|
||||||
<DropdownMenu>
|
<div className="mx-1">
|
||||||
<DropdownMenuTrigger asChild>
|
<DropdownMenu>
|
||||||
<Button className="capitalize" variant="outline">
|
<DropdownMenuTrigger asChild>
|
||||||
{camera?.replaceAll("_", " ") || "Select A Camera"}
|
<Button className="capitalize" variant="outline">
|
||||||
</Button>
|
{camera?.replaceAll("_", " ") || "Select A Camera"}
|
||||||
</DropdownMenuTrigger>
|
</Button>
|
||||||
<DropdownMenuContent>
|
</DropdownMenuTrigger>
|
||||||
<DropdownMenuLabel>Select A Camera</DropdownMenuLabel>
|
<DropdownMenuContent>
|
||||||
<DropdownMenuSeparator />
|
<DropdownMenuLabel>Select A Camera</DropdownMenuLabel>
|
||||||
<DropdownMenuRadioGroup value={camera} onValueChange={setCamera}>
|
<DropdownMenuSeparator />
|
||||||
{sortedCameras.map((item) => (
|
<DropdownMenuRadioGroup
|
||||||
<DropdownMenuRadioItem
|
value={camera}
|
||||||
className="capitalize"
|
onValueChange={setCamera}
|
||||||
key={item.name}
|
>
|
||||||
value={item.name}
|
{config?.birdseye.enabled && (
|
||||||
>
|
<DropdownMenuRadioItem value="birdseye">
|
||||||
{item.name.replaceAll("_", " ")}
|
Birdseye
|
||||||
|
</DropdownMenuRadioItem>
|
||||||
|
)}
|
||||||
|
{sortedCameras.map((item) => (
|
||||||
|
<DropdownMenuRadioItem
|
||||||
|
className="capitalize"
|
||||||
|
key={item.name}
|
||||||
|
value={item.name}
|
||||||
|
>
|
||||||
|
{item.name.replaceAll("_", " ")}
|
||||||
|
</DropdownMenuRadioItem>
|
||||||
|
))}
|
||||||
|
</DropdownMenuRadioGroup>
|
||||||
|
</DropdownMenuContent>
|
||||||
|
</DropdownMenu>
|
||||||
|
</div>
|
||||||
|
<div className="mx-1">
|
||||||
|
<DropdownMenu>
|
||||||
|
<DropdownMenuTrigger asChild>
|
||||||
|
<Button className="capitalize" variant="outline">
|
||||||
|
{viewSource || defaultLiveMode || "Select A Live Mode"}
|
||||||
|
</Button>
|
||||||
|
</DropdownMenuTrigger>
|
||||||
|
<DropdownMenuContent>
|
||||||
|
<DropdownMenuLabel>Select A Live Mode</DropdownMenuLabel>
|
||||||
|
<DropdownMenuSeparator />
|
||||||
|
<DropdownMenuRadioGroup
|
||||||
|
value={`${viewSource}`}
|
||||||
|
onValueChange={setViewSource}
|
||||||
|
>
|
||||||
|
{restreamEnabled && (
|
||||||
|
<DropdownMenuRadioItem value="webrtc">
|
||||||
|
Webrtc
|
||||||
|
</DropdownMenuRadioItem>
|
||||||
|
)}
|
||||||
|
{restreamEnabled && (
|
||||||
|
<DropdownMenuRadioItem value="mse">
|
||||||
|
MSE
|
||||||
|
</DropdownMenuRadioItem>
|
||||||
|
)}
|
||||||
|
<DropdownMenuRadioItem value="jsmpeg">
|
||||||
|
Jsmpeg
|
||||||
</DropdownMenuRadioItem>
|
</DropdownMenuRadioItem>
|
||||||
))}
|
{camera != "birdseye" && (
|
||||||
</DropdownMenuRadioGroup>
|
<DropdownMenuRadioItem value="debug">
|
||||||
</DropdownMenuContent>
|
Debug
|
||||||
</DropdownMenu>
|
</DropdownMenuRadioItem>
|
||||||
<DropdownMenu>
|
)}
|
||||||
<DropdownMenuTrigger asChild>
|
</DropdownMenuRadioGroup>
|
||||||
<Button className="capitalize" variant="outline">
|
</DropdownMenuContent>
|
||||||
{viewSource || defaultLiveMode || "Select A Live Mode"}
|
</DropdownMenu>
|
||||||
</Button>
|
</div>
|
||||||
</DropdownMenuTrigger>
|
|
||||||
<DropdownMenuContent>
|
|
||||||
<DropdownMenuLabel>Select A Live Mode</DropdownMenuLabel>
|
|
||||||
<DropdownMenuSeparator />
|
|
||||||
<DropdownMenuRadioGroup
|
|
||||||
value={`${viewSource}`}
|
|
||||||
onValueChange={setViewSource}
|
|
||||||
>
|
|
||||||
<DropdownMenuRadioItem value="webrtc">
|
|
||||||
Webrtc
|
|
||||||
</DropdownMenuRadioItem>
|
|
||||||
<DropdownMenuRadioItem value="mse">MSE</DropdownMenuRadioItem>
|
|
||||||
<DropdownMenuRadioItem value="jsmpeg">
|
|
||||||
Jsmpeg
|
|
||||||
</DropdownMenuRadioItem>
|
|
||||||
<DropdownMenuRadioItem value="debug">
|
|
||||||
Debug
|
|
||||||
</DropdownMenuRadioItem>
|
|
||||||
</DropdownMenuRadioGroup>
|
|
||||||
</DropdownMenuContent>
|
|
||||||
</DropdownMenu>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{config && camera == "birdseye" && sourceIsLoaded && (
|
{config && camera == "birdseye" && sourceIsLoaded && (
|
||||||
|
|||||||
@ -16,7 +16,7 @@ export function getHourlyTimelineData(
|
|||||||
|
|
||||||
// build a map of course to the types that are included in this hour
|
// 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
|
// 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 } = {};
|
let cardTypeStart: { [camera: string]: number } = {};
|
||||||
Object.values(hourlyTimeline["hours"][hour]).forEach((i) => {
|
Object.values(hourlyTimeline["hours"][hour]).forEach((i) => {
|
||||||
if (i.timestamp > (cardTypeStart[i.camera] ?? 0) + GROUP_SECONDS) {
|
if (i.timestamp > (cardTypeStart[i.camera] ?? 0) + GROUP_SECONDS) {
|
||||||
@ -25,10 +25,10 @@ export function getHourlyTimelineData(
|
|||||||
|
|
||||||
const groupKey = `${i.source_id}-${cardTypeStart[i.camera]}`;
|
const groupKey = `${i.source_id}-${cardTypeStart[i.camera]}`;
|
||||||
|
|
||||||
if (groupKey in source_to_types) {
|
if (groupKey in sourceToTypes) {
|
||||||
source_to_types[groupKey].push(i.class_type);
|
sourceToTypes[groupKey].push(i.class_type);
|
||||||
} else {
|
} else {
|
||||||
source_to_types[groupKey] = [i.class_type];
|
sourceToTypes[groupKey] = [i.class_type];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -61,7 +61,7 @@ export function getHourlyTimelineData(
|
|||||||
let add = true;
|
let add = true;
|
||||||
if (detailLevel == "normal") {
|
if (detailLevel == "normal") {
|
||||||
if (
|
if (
|
||||||
source_to_types[sourceKey].length > 1 &&
|
sourceToTypes[sourceKey].length > 1 &&
|
||||||
["active", "attribute", "gone", "stationary", "visible"].includes(
|
["active", "attribute", "gone", "stationary", "visible"].includes(
|
||||||
i.class_type
|
i.class_type
|
||||||
)
|
)
|
||||||
@ -70,8 +70,8 @@ export function getHourlyTimelineData(
|
|||||||
}
|
}
|
||||||
} else if (detailLevel == "extra") {
|
} else if (detailLevel == "extra") {
|
||||||
if (
|
if (
|
||||||
source_to_types[sourceKey].length > 1 &&
|
sourceToTypes[sourceKey].length > 1 &&
|
||||||
i.class_type in ["attribute", "gone", "visible"]
|
["attribute", "gone", "visible"].includes(i.class_type)
|
||||||
) {
|
) {
|
||||||
add = false;
|
add = false;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user