From 13a7e4d3e1cd92700e65526b3e67a9c025425f61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Calvi=C3=B1o=20S=C3=A1nchez?= Date: Mon, 30 Mar 2020 09:49:28 +0200 Subject: Fix trying to create Peer for participant without streams MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When the MCU is used, if a participant does not send audio nor video streams the self Peer to connect to the MCU is not created. Due to this requesting an offer from that participant never succeeds, and thus a Peer to get the streams will never be created. Signed-off-by: Daniel Calviño Sánchez --- src/utils/webrtc/webrtc.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils/webrtc/webrtc.js b/src/utils/webrtc/webrtc.js index 1f56b686c..367b8aeb1 100644 --- a/src/utils/webrtc/webrtc.js +++ b/src/utils/webrtc/webrtc.js @@ -207,7 +207,7 @@ function usersChanged(signaling, newUsers, disconnectedSessionIds) { } if (!webrtc.webrtc.getPeers(sessionId, 'video').length) { - if (useMcu) { + if (useMcu && userHasStreams(user)) { // TODO(jojo): Already create peer object to avoid duplicate offers. signaling.requestOffer(user, 'video') @@ -216,13 +216,13 @@ function usersChanged(signaling, newUsers, disconnectedSessionIds) { signaling.requestOffer(user, 'video') }, 10000) - } else if (userHasStreams(selfInCall) && (!userHasStreams(user) || sessionId < currentSessionId)) { + } else if (!useMcu && userHasStreams(selfInCall) && (!userHasStreams(user) || sessionId < currentSessionId)) { // To avoid overloading the user joining a room (who previously called // all the other participants), we decide who calls who by comparing // the session ids of the users: "larger" ids call "smaller" ones. console.debug('Starting call with', user) createPeer() - } else if (userHasStreams(selfInCall) && userHasStreams(user) && sessionId > currentSessionId) { + } else if (!useMcu && userHasStreams(selfInCall) && userHasStreams(user) && sessionId > currentSessionId) { // If the remote peer is not aware that it was disconnected // from the current peer the remote peer will not send a new // offer; thus, if the current peer does not receive a new -- cgit v1.2.3