mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-11 05:35:25 +03:00
Use go2rtc stream info to infer audio output
This commit is contained in:
parent
6ee800c1ff
commit
4fb0b0089d
@ -99,10 +99,22 @@ export default function LiveCameraView({ camera }: LiveCameraViewProps) {
|
||||
return (
|
||||
cameraMetadata.producers.find(
|
||||
(prod) =>
|
||||
prod.medias.find((media) => media.includes("sendonly")) != undefined,
|
||||
prod.medias.find((media) => media.includes("audio, sendonly")) != undefined,
|
||||
) != undefined
|
||||
);
|
||||
}, [cameraMetadata]);
|
||||
const supportsAudioOutput = useMemo(() => {
|
||||
if (!cameraMetadata) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return (
|
||||
cameraMetadata.producers.find(
|
||||
(prod) =>
|
||||
prod.medias.find((media) => media.includes("audio, recvonly")) != undefined,
|
||||
) != undefined
|
||||
);
|
||||
}, [cameraMetadata])
|
||||
|
||||
// click overlay for ptzs
|
||||
|
||||
@ -337,14 +349,14 @@ export default function LiveCameraView({ camera }: LiveCameraViewProps) {
|
||||
onClick={() => setMic(!mic)}
|
||||
/>
|
||||
)}
|
||||
<CameraFeatureToggle
|
||||
{supportsAudioOutput && <CameraFeatureToggle
|
||||
className="p-2 md:p-0"
|
||||
variant={fullscreen ? "overlay" : "primary"}
|
||||
Icon={audio ? GiSpeaker : GiSpeakerOff}
|
||||
isActive={audio}
|
||||
title={`${audio ? "Disable" : "Enable"} Camera Audio`}
|
||||
onClick={() => setAudio(!audio)}
|
||||
/>
|
||||
/>}
|
||||
<FrigateCameraFeatures
|
||||
camera={camera.name}
|
||||
audioDetectEnabled={camera.audio.enabled_in_config}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user