From 2b9e28ee4a3a9976ff078ef2293f9b5cec6cc41b Mon Sep 17 00:00:00 2001 From: RoyceDa Date: Mon, 30 Mar 2026 19:41:06 +0200 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D1=81=D0=B8=D1=81=D1=82=D0=B5=D0=BC?= =?UTF-8?q?=D0=BD=D1=8B=D1=85=20=D0=B7=D0=B2=D1=83=D0=BA=D0=BE=D0=B2=20?= =?UTF-8?q?=D0=B2=20=D0=B7=D0=B2=D0=BE=D0=BD=D0=BA=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/providers/CallProvider/CallProvider.tsx | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/app/providers/CallProvider/CallProvider.tsx b/app/providers/CallProvider/CallProvider.tsx index 8098a71..92753a7 100644 --- a/app/providers/CallProvider/CallProvider.tsx +++ b/app/providers/CallProvider/CallProvider.tsx @@ -323,6 +323,13 @@ export function CallProvider(props : CallProviderProps) { peerConnectionRef.current.onconnectionstatechange = () => { console.info("Peer connection state changed: " + peerConnectionRef.current?.connectionState); if(peerConnectionRef.current?.connectionState == "connected"){ + /** + * WebRTC соединение установлено, звонок активен, останавливаем все остальные звуки + * системы + */ + stopLoopSound(); + stopSound(); + setCallState(CallState.ACTIVE); info("WebRTC connection established, call is active"); } @@ -432,8 +439,13 @@ export function CallProvider(props : CallProviderProps) { } const end = () => { - stopLoopSound(); - stopSound(); + if(callState == CallState.ACTIVE){ + /** + * Только если звонок был активен воспроизводим звуки + */ + stopLoopSound(); + stopSound(); + } if (remoteAudioRef.current) { remoteAudioRef.current.pause(); remoteAudioRef.current.srcObject = null;