From 1d138701242d9beb251d0bcfcc7d07b966aa862a Mon Sep 17 00:00:00 2001 From: Yordan Neshkolov Date: Tue, 5 May 2020 20:00:25 +0300 Subject: [PATCH] NY-10163 [WEB]: Participant can not hear the audio of other participants after rejoining the call. --- src/call/Call.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/call/Call.js b/src/call/Call.js index f57a1f2..307c86f 100644 --- a/src/call/Call.js +++ b/src/call/Call.js @@ -132,8 +132,10 @@ class Call { member.mediaContainer = element; if (participantId) { - const callParticipantData = this._checkCallParticipantData(participantId); - callParticipantData.mediaContainer = element; + const callParticipantData = this._checkCallParticipantData(participantId, !element); + if (callParticipantData) { + callParticipantData.mediaContainer = element; + } } } @@ -1375,7 +1377,7 @@ class Call { this._remoteScreenSharer = null; } - if (this._audioCtx) { + if (this._audioCtx && this._audioCtx.state !== 'closed') { this._audioCtx.close(); this._audioCtx = null; } @@ -1617,8 +1619,8 @@ class Call { return mediaElement; } - _checkCallParticipantData = (participantId) => { - if (!this._callParticipantsData[participantId]) { + _checkCallParticipantData = (participantId, skipCreate) => { + if (!this._callParticipantsData[participantId] && !skipCreate) { this._callParticipantsData[participantId] = new CallParticipantData(participantId, this._audioCtx); this._callParticipantsData[participantId].mute = this._speakerMuted; const member = this.findParticipant(participantId); -- GitLab