diff --git a/libs/colibri/colibri.focus.js b/libs/colibri/colibri.focus.js index e9dd799fb..4ba0441c9 100644 --- a/libs/colibri/colibri.focus.js +++ b/libs/colibri/colibri.focus.js @@ -102,14 +102,10 @@ ColibriFocus.prototype.makeConference = function (peers) { */ }; this.peerconnection.onaddstream = function (event) { - self.remoteStream = event.stream; // search the jid associated with this stream Object.keys(self.remotessrc).forEach(function (jid) { if (self.remotessrc[jid].join('\r\n').indexOf('mslabel:' + event.stream.id) != -1) { event.peerjid = jid; - if (self.connection.jingle.jid2session[jid]) { - self.connection.jingle.jid2session[jid].remotestream = event.stream; - } } }); $(document).trigger('remotestreamadded.jingle', [event, self.sid]); diff --git a/libs/strophe/strophe.jingle.session.js b/libs/strophe/strophe.jingle.session.js index 4c8febb17..69f7b228b 100644 --- a/libs/strophe/strophe.jingle.session.js +++ b/libs/strophe/strophe.jingle.session.js @@ -22,7 +22,6 @@ function JingleSession(me, sid, connection) { console.error(e); } - this.remoteStream = null; this.localSDP = null; this.remoteSDP = null; this.localStreams = []; @@ -69,13 +68,15 @@ JingleSession.prototype.initiate = function (peerjid, isInitiator) { self.sendIceCandidate(event.candidate); }; this.peerconnection.onaddstream = function (event) { - self.remoteStream = event.stream; self.remoteStreams.push(event.stream); $(document).trigger('remotestreamadded.jingle', [event, self.sid]); }; this.peerconnection.onremovestream = function (event) { - self.remoteStream = null; - // FIXME: remove from this.remoteStreams + // Remove the stream from remoteStreams + var streamIdx = self.remoteStreams.indexOf(event.stream); + if(streamIdx !== -1){ + self.remoteStreams.splice(streamIdx, 1); + } // FIXME: remotestreamremoved.jingle not defined anywhere(unused) $(document).trigger('remotestreamremoved.jingle', [event, self.sid]); };