Handle audio-less
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
parent
4ac5c2c677
commit
b2427bd810
1 changed files with 3 additions and 3 deletions
|
@ -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<GainNode>();
|
||||
const sourceRef = useRef<MediaStreamAudioSourceNode>();
|
||||
|
||||
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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue