From b15c20115ddb59391d0206064cbaa1b0026029c9 Mon Sep 17 00:00:00 2001 From: Yordan Neshkolov Date: Mon, 1 Jun 2020 18:58:56 +0300 Subject: [PATCH 1/2] NY-10508 [WEB]: Missing audio on rejoin in conference with FF and Safari: possible fix --- src/call/Call.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/call/Call.js b/src/call/Call.js index 3cfd435..b2dea07 100644 --- a/src/call/Call.js +++ b/src/call/Call.js @@ -1523,6 +1523,17 @@ class Call { } }); callParticipantData.mediaStream.addTrack(track); + // Safari and FF workaround + if (stream && this.isConference && (isUnifiedPlanSupported() || this.forceUnifiedPlan)) { + stream.onremovetrack = (e) => { + this._pc.getTransceivers().forEach(transceiver => { + if (transceiver.mid === mid) { + transceiver.stop(); + } + }) + console.log('[SDK] [webrtc] stream.onremovetrack - audio', e.track.muted); + }; + } } callParticipantData.reloadMedia(); } -- GitLab From 86d559974144d5bde61f7e389c994cc2d20f1e02 Mon Sep 17 00:00:00 2001 From: Yordan Neshkolov Date: Mon, 1 Jun 2020 19:20:12 +0300 Subject: [PATCH 2/2] NY-10508 [WEB]: Missing audio on rejoin in conference with FF and Safari: code clean up --- src/call/Call.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/call/Call.js b/src/call/Call.js index b2dea07..eb827cb 100644 --- a/src/call/Call.js +++ b/src/call/Call.js @@ -1526,12 +1526,14 @@ class Call { // Safari and FF workaround if (stream && this.isConference && (isUnifiedPlanSupported() || this.forceUnifiedPlan)) { stream.onremovetrack = (e) => { - this._pc.getTransceivers().forEach(transceiver => { - if (transceiver.mid === mid) { - transceiver.stop(); - } - }) - console.log('[SDK] [webrtc] stream.onremovetrack - audio', e.track.muted); + if (this._pc && this._pc.getTransceivers) { + this._pc.getTransceivers().forEach(transceiver => { + if (transceiver.mid === mid) { + transceiver.stop(); + } + }); + } + console.log('[SDK] [webrtc] stream.onremovetrack - audio', e.track.muted, e.track.readyState); }; } } -- GitLab