From b2427bd8104d466fb9cc0527b35acb8306c3e608 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Sat, 13 Aug 2022 18:29:30 +0200 Subject: [PATCH] Handle audio-less MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Brandner --- src/video-grid/AudioContainer.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/video-grid/AudioContainer.tsx b/src/video-grid/AudioContainer.tsx index a60e195..067d088 100644 --- a/src/video-grid/AudioContainer.tsx +++ b/src/video-grid/AudioContainer.tsx @@ -33,13 +33,13 @@ export function AudioForParticipant({ audioContext, audioDestination, }: AudioForParticipantProps): JSX.Element { - const { stream, localVolume } = useCallFeed(item.callFeed); + const { stream, localVolume, audioMuted } = useCallFeed(item.callFeed); const gainNodeRef = useRef(); const sourceRef = useRef(); useEffect(() => { - if (!item.isLocal && audioContext) { + if (!item.isLocal && audioContext && !audioMuted) { if (!gainNodeRef.current) { gainNodeRef.current = new GainNode(audioContext, { gain: localVolume, @@ -60,7 +60,7 @@ export function AudioForParticipant({ gainNode.disconnect(); }; } - }, [item, audioContext, audioDestination, stream, localVolume]); + }, [item, audioContext, audioDestination, stream, localVolume, audioMuted]); return null; }