From 555dc8ad36929fd481b6e8ed5fd090fce4c64b8e Mon Sep 17 00:00:00 2001 From: Boris Grozev Date: Mon, 24 Aug 2015 14:59:26 -0500 Subject: [PATCH] Switches the order of the parameters of desktopsharing.addListener to match the rest of the code. Renames variables. --- modules/RTC/RTC.js | 10 +++++----- modules/xmpp/JingleSessionPC.js | 21 +++++++++++---------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/modules/RTC/RTC.js b/modules/RTC/RTC.js index 29cb02c1a..978338c38 100644 --- a/modules/RTC/RTC.js +++ b/modules/RTC/RTC.js @@ -22,10 +22,10 @@ function RTC(room, options) { this.eventEmitter = new EventEmitter(); var self = this; this.options = options || {}; - desktopsharing.addListener( + desktopsharing.addListener(DesktopSharingEventTypes.NEW_STREAM_CREATED, function (stream, isUsingScreenStream, callback) { self.changeLocalVideo(stream, isUsingScreenStream, callback); - }, DesktopSharingEventTypes.NEW_STREAM_CREATED); + }); room.addPresenceListener("videomuted", function (values, from) { if(self.remoteStreams[from]) self.remoteStreams[from][JitsiTrack.VIDEO].setMute(values.value == "true"); @@ -208,13 +208,13 @@ RTC.prototype.muteRemoteVideoStream = function (jid, value) { return false; }; -RTC.prototype.switchVideoStreams = function (new_stream) { - this.localVideo.stream = new_stream; +RTC.prototype.switchVideoStreams = function (newStream) { + this.localVideo.stream = newStream; this.localStreams = []; //in firefox we have only one stream object - if (this.localAudio.getOriginalStream() != new_stream) + if (this.localAudio.getOriginalStream() != newStream) this.localStreams.push(this.localAudio); this.localStreams.push(this.localVideo); }; diff --git a/modules/xmpp/JingleSessionPC.js b/modules/xmpp/JingleSessionPC.js index 024a8709e..2c20d10d9 100644 --- a/modules/xmpp/JingleSessionPC.js +++ b/modules/xmpp/JingleSessionPC.js @@ -1067,28 +1067,29 @@ JingleSessionPC.prototype._modifySources = function (successCallback, queueCallb /** * Switches video streams. - * @param new_stream new stream that will be used as video of this session. + * @param newStream new stream that will be used as video of this session. * @param oldStream old video stream of this session. - * @param success_callback callback executed after successful stream switch. + * @param successCallback callback executed after successful stream switch. */ -JingleSessionPC.prototype.switchStreams = function (new_stream, oldStream, success_callback, isAudio) { +JingleSessionPC.prototype.switchStreams = + function (newStream, oldStream, successCallback) { var self = this; // Remember SDP to figure out added/removed SSRCs var oldSdp = null; - if(self.peerconnection) { - if(self.peerconnection.localDescription) { + if (self.peerconnection) { + if (self.peerconnection.localDescription) { oldSdp = new SDP(self.peerconnection.localDescription.sdp); } self.peerconnection.removeStream(oldStream, true); - if(new_stream) - self.peerconnection.addStream(new_stream); + if (newStream) + self.peerconnection.addStream(newStream); } // Conference is not active - if(!oldSdp || !self.peerconnection) { - success_callback(); + if (!oldSdp) { + successCallback(); return; } @@ -1096,7 +1097,7 @@ JingleSessionPC.prototype.switchStreams = function (new_stream, oldStream, succe self.modifySourcesQueue.push(function() { logger.log('modify sources done'); - success_callback(); + successCallback(); var newSdp = new SDP(self.peerconnection.localDescription.sdp); logger.log("SDPs", oldSdp, newSdp);