Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.
TypeScript debiandeep-videojitsijitsi-meetscalable-video-conferencessfuvideovideo-communicationvideo-conferencingwebrtc
Removes a tangle of spaghetti.
Boris Grozev91117979130b
diff --git a/modules/RTC/RTC.js b/modules/RTC/RTC.jsindex 901f7fd624..3edf995062 100644--- a/modules/RTC/RTC.js+++ b/modules/RTC/RTC.js@@ -53,7 +53,6 @@ var RTC = {audio: true,video: true},- localStreams: [],remoteStreams: {},localAudio: null,localVideo: null,@@ -74,10 +73,6 @@ var RTC = {var localStream =new LocalStream(stream, type, eventEmitter, videoType, isGUMStream);- //in firefox we have only one stream object- if(this.localStreams.length === 0 ||- this.localStreams[0].getOriginalStream() != stream)- this.localStreams.push(localStream);if(isMuted === true)localStream.setMute(true);@@ -93,14 +88,6 @@ var RTC = {eventEmitter.emit(eventType, localStream, isMuted);return localStream;},- removeLocalStream: function (stream) {- for(var i = 0; i < this.localStreams.length; i++) {- if(this.localStreams[i].getOriginalStream() === stream) {- delete this.localStreams[i];- return;- }- }- },createRemoteStream: function (data, ssrc) {var jid = data.peerjid || APP.xmpp.myJid();@@ -203,16 +190,6 @@ var RTC = {}return false;},- switchVideoStreams: function (newStream) {- this.localVideo.stream = newStream;-- this.localStreams = [];-- //in firefox we have only one stream object- if (this.localAudio.getOriginalStream() != newStream)- this.localStreams.push(this.localAudio);- this.localStreams.push(this.localVideo);- },changeLocalVideo: function (stream, isUsingScreenStream, callback) {var oldStream = this.localVideo.getOriginalStream();var type = (isUsingScreenStream ? "screen" : "camera");@@ -236,8 +213,6 @@ var RTC = {// Stop the stream to trigger onended event for old streamoldStream.stop();- this.switchVideoStreams(videoStream);-APP.xmpp.switchStreams(videoStream, oldStream,localCallback);},changeLocalAudio: function (stream, callback) {diff --git a/modules/xmpp/JingleSessionPC.js b/modules/xmpp/JingleSessionPC.jsindex 1715da8020..cb5b4a30b9 100644--- a/modules/xmpp/JingleSessionPC.js+++ b/modules/xmpp/JingleSessionPC.js@@ -20,7 +20,6 @@ function JingleSessionPC(me, sid, connection, service, eventEmitter) {this.state = null;this.localSDP = null;this.remoteSDP = null;- this.relayedStreams = [];this.pc_constraints = null;this.usetrickle = true;@@ -169,13 +168,12 @@ JingleSessionPC.prototype.doInitialize = function () {this.peerconnection.onnegotiationneeded = function (event) {self.eventEmitter.emit(XMPPEvents.PEERCONNECTION_READY, self);};- // add any local and relayed stream- APP.RTC.localStreams.forEach(function(stream) {- self.peerconnection.addStream(stream.getOriginalStream());- });- this.relayedStreams.forEach(function(stream) {- self.peerconnection.addStream(stream);- });+ if (APP.RTC.localAudio) {+ self.peerconnection.addStream(APP.RTC.localAudio.getOriginalStream());+ }+ if (APP.RTC.localVideo) {+ self.peerconnection.addStream(APP.RTC.localVideo.getOriginalStream());+ }};function onIceConnectionStateChange(sid, session) {