diff --git a/lib/webrtc/call.js b/lib/webrtc/call.js index c3dd153c9..eade977e1 100644 --- a/lib/webrtc/call.js +++ b/lib/webrtc/call.js @@ -522,17 +522,14 @@ MatrixCall.prototype._gotUserMediaForInvite = function(stream) { }, 0); } + this.screenSharingStream.addTrack(stream.getAudioTracks()[0]); + stream = this.screenSharingStream; + this.localAVStream = stream; // why do we enable audio (and only audio) tracks here? -- matthew setTracksEnabled(stream.getAudioTracks(), true); this.peerConn = _createPeerConnection(this); this.peerConn.addStream(stream); - if (this.screenSharingStream) { - console.log("Adding screen-sharing stream to peer connection"); - this.peerConn.addStream(this.screenSharingStream); - // let's use this for the local preview... - this.localAVStream = this.screenSharingStream; - } this.peerConn.createOffer( hookCallback(self, self._gotLocalOffer), hookCallback(self, self._getLocalOfferFailed)