summaryrefslogtreecommitdiffstats
path: root/src/utils/webrtc/webrtc.js
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2020-03-30 09:49:28 +0200
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2020-03-30 09:49:28 +0200
commit13a7e4d3e1cd92700e65526b3e67a9c025425f61 (patch)
tree008d489c510a5b063501dfb738c6c98450b4db73 /src/utils/webrtc/webrtc.js
parent302154a2173a2750268f0344c74c4bb500aefeb0 (diff)
Fix trying to create Peer for participant without streams
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 <danxuliu@gmail.com>
Diffstat (limited to 'src/utils/webrtc/webrtc.js')
-rw-r--r--src/utils/webrtc/webrtc.js6
1 files 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