Skip to content

Commit

Permalink
Remove unneeded code
Browse files Browse the repository at this point in the history
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 <danxuliu@gmail.com>
  • Loading branch information
danxuliu committed Sep 24, 2020
1 parent 05833cd commit 77b541f
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions src/utils/webrtc/simplewebrtc/simplewebrtc.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 77b541f

Please sign in to comment.