mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-08-01 08:32:18 +03:00
Improve handling of backchannel audio in camera wizard (#21250)
* Improve handling of backchannel audio in camera wizard * Cleanup * look for backchannel on all registered streams on save avoids potential issues with a timeout in stream registration --------- Co-authored-by: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com>
This commit is contained in:
co-authored by
Josh Hawkins
parent
6b9b3778f5
commit
8ddcbf9a8d
@@ -3,6 +3,7 @@ import { useCallback, useEffect, useState, useMemo } from "react";
|
||||
import useSWR from "swr";
|
||||
import { LivePlayerMode } from "@/types/live";
|
||||
import useDeferredStreamMetadata from "./use-deferred-stream-metadata";
|
||||
import { detectCameraAudioFeatures } from "@/utils/cameraUtil";
|
||||
|
||||
export default function useCameraLiveMode(
|
||||
cameras: CameraConfig[],
|
||||
@@ -83,16 +84,9 @@ export default function useCameraLiveMode(
|
||||
if (isRestreamed) {
|
||||
Object.values(camera.live.streams).forEach((streamName) => {
|
||||
const metadata = streamMetadata[streamName];
|
||||
const audioFeatures = detectCameraAudioFeatures(metadata);
|
||||
newSupportsAudioOutputStates[streamName] = {
|
||||
supportsAudio: metadata
|
||||
? metadata.producers.find(
|
||||
(prod) =>
|
||||
prod.medias &&
|
||||
prod.medias.find((media) =>
|
||||
media.includes("audio, recvonly"),
|
||||
) !== undefined,
|
||||
) !== undefined
|
||||
: false,
|
||||
supportsAudio: audioFeatures.audioOutput,
|
||||
cameraName: camera.name,
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user