Исправление системных звуков в звонке
Some checks failed
SP Builds / build (push) Has been cancelled
Some checks failed
SP Builds / build (push) Has been cancelled
This commit is contained in:
@@ -323,6 +323,13 @@ export function CallProvider(props : CallProviderProps) {
|
|||||||
peerConnectionRef.current.onconnectionstatechange = () => {
|
peerConnectionRef.current.onconnectionstatechange = () => {
|
||||||
console.info("Peer connection state changed: " + peerConnectionRef.current?.connectionState);
|
console.info("Peer connection state changed: " + peerConnectionRef.current?.connectionState);
|
||||||
if(peerConnectionRef.current?.connectionState == "connected"){
|
if(peerConnectionRef.current?.connectionState == "connected"){
|
||||||
|
/**
|
||||||
|
* WebRTC соединение установлено, звонок активен, останавливаем все остальные звуки
|
||||||
|
* системы
|
||||||
|
*/
|
||||||
|
stopLoopSound();
|
||||||
|
stopSound();
|
||||||
|
|
||||||
setCallState(CallState.ACTIVE);
|
setCallState(CallState.ACTIVE);
|
||||||
info("WebRTC connection established, call is active");
|
info("WebRTC connection established, call is active");
|
||||||
}
|
}
|
||||||
@@ -432,8 +439,13 @@ export function CallProvider(props : CallProviderProps) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const end = () => {
|
const end = () => {
|
||||||
stopLoopSound();
|
if(callState == CallState.ACTIVE){
|
||||||
stopSound();
|
/**
|
||||||
|
* Только если звонок был активен воспроизводим звуки
|
||||||
|
*/
|
||||||
|
stopLoopSound();
|
||||||
|
stopSound();
|
||||||
|
}
|
||||||
if (remoteAudioRef.current) {
|
if (remoteAudioRef.current) {
|
||||||
remoteAudioRef.current.pause();
|
remoteAudioRef.current.pause();
|
||||||
remoteAudioRef.current.srcObject = null;
|
remoteAudioRef.current.srcObject = null;
|
||||||
|
|||||||
Reference in New Issue
Block a user