Removes unused remoteStream variable. Fixes stream removal from remoteStreams array.
This commit is contained in:
parent
9fd03e1bef
commit
a2633e20e8
|
@ -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]);
|
||||
|
|
|
@ -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]);
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue