From 77b541f607c2fd5eafed8d5fa94e0870d7509843 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Calvi=C3=B1o=20S=C3=A1nchez?= Date: Sat, 19 Sep 2020 03:19:35 +0200 Subject: [PATCH] Remove unneeded code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When the HPB is used now the initial state is repeated several times after a connection with another participant is established, so the little wait here is no longer needed. When the HPB is not used the initial state is send just once, but as in that case both participants are already aware of each other the little wait is not needed either. Signed-off-by: Daniel Calviño Sánchez --- src/utils/webrtc/simplewebrtc/simplewebrtc.js | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/utils/webrtc/simplewebrtc/simplewebrtc.js b/src/utils/webrtc/simplewebrtc/simplewebrtc.js index 1aa6c70d4d9e..05e1e0f0f6f7 100644 --- a/src/utils/webrtc/simplewebrtc/simplewebrtc.js +++ b/src/utils/webrtc/simplewebrtc/simplewebrtc.js @@ -260,7 +260,6 @@ SimpleWebRTC.prototype.disconnect = function() { } SimpleWebRTC.prototype.handlePeerStreamAdded = function(peer) { - const self = this const container = this.getRemoteVideoContainer() if (container) { // If there is a video track Chromium does not play audio in a video element @@ -291,19 +290,6 @@ SimpleWebRTC.prototype.handlePeerStreamAdded = function(peer) { this.emit('videoAdded', video, audio, peer) } - - // send our mute status to new peer if we're muted - // currently called with a small delay because it arrives before - // the video element is created otherwise (which happens after - // the async setRemoteDescription-createAnswer) - window.setTimeout(function() { - if (!self.webrtc.isAudioEnabled()) { - peer.send('mute', { name: 'audio' }) - } - if (!self.webrtc.isVideoEnabled()) { - peer.send('mute', { name: 'video' }) - } - }, 250) } SimpleWebRTC.prototype.handlePeerStreamRemoved = function(peer) {