Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

Removes browser checks. Optimizes the browser specific code.

hristoterezov99da618811df
diff --git a/app.js b/app.js
index 6959ce8d25..e6986591f7 100644
--- a/app.js
+++ b/app.js
@@ -13,7 +13,9 @@ var roomName = null;
var ssrc2jid = {};
var mediaStreams = [];
var bridgeIsDown = false;
+//TODO: this array must be removed when firefox implement multistream support
var notReceivedSSRCs = [];
+
var jid2Ssrc = {};
/**
@@ -91,11 +93,9 @@ function init() {
}
else
{
- VideoLayout.changeLocalAudio(stream);
+ VideoLayout.changeLocalStream(stream);
startLocalRtpStatsCollector(stream);
-
- VideoLayout.changeLocalVideo(stream, true);
}
@@ -332,6 +332,7 @@ function waitForPresence(data, sid) {
}
}
+ //TODO: this code should be removed when firefox implement multistream support
if(RTC.browser == "firefox")
{
if((notReceivedSSRCs.length == 0) ||
diff --git a/libs/strophe/strophe.jingle.adapter.js b/libs/strophe/strophe.jingle.adapter.js
index 14850157ab..6496753722 100644
--- a/libs/strophe/strophe.jingle.adapter.js
+++ b/libs/strophe/strophe.jingle.adapter.js
@@ -5,7 +5,6 @@ function TraceablePeerConnection(ice_config, constraints) {
this.updateLog = [];
this.stats = {};
this.statsinterval = null;
- this.originalRemoteDescription = null;
this.maxstats = 0; // limit to 300 values, i.e. 5 minutes; set to 0 to disable
/**
@@ -188,7 +187,6 @@ TraceablePeerConnection.prototype.setRemoteDescription = function (description,
var self = this;
description = simulcast.transformRemoteDescription(description);
this.trace('setRemoteDescription', dumpSDP(description));
- this.originalRemoteDescription = description;
this.peerconnection.setRemoteDescription(description,
function () {
self.trace('setRemoteDescriptionOnSuccess');
diff --git a/libs/strophe/strophe.jingle.js b/libs/strophe/strophe.jingle.js
index 98f54b7dff..76b9e42812 100644
--- a/libs/strophe/strophe.jingle.js
+++ b/libs/strophe/strophe.jingle.js
@@ -84,7 +84,9 @@ Strophe.addConnectionPlugin('jingle', {
case 'session-initiate':
sess = new JingleSession($(iq).attr('to'), $(iq).find('jingle').attr('sid'), this.connection);
// configure session
- if (this.localAudio && RTC.browser == "chrome") {
+
+ //in firefox we have only one stream object
+ if (this.localAudio != this.localVideo) {
sess.localStreams.push(this.localAudio);
}
if (this.localVideo) {
@@ -169,7 +171,9 @@ Strophe.addConnectionPlugin('jingle', {
Math.random().toString(36).substr(2, 12), // random string
this.connection);
// configure session
- if (this.localAudio && RTC.browser == "chrome") {
+
+ //in firefox we have only one stream
+ if (this.localAudio != this.localVideo) {
sess.localStreams.push(this.localAudio);
}
if (this.localVideo) {
diff --git a/libs/strophe/strophe.jingle.sessionbase.js b/libs/strophe/strophe.jingle.sessionbase.js
index eb6a783271..6d58aa8c6d 100644
--- a/libs/strophe/strophe.jingle.sessionbase.js
+++ b/libs/strophe/strophe.jingle.sessionbase.js
@@ -89,7 +89,9 @@ SessionBase.prototype.switchStreams = function (new_stream, oldStream, success_c
self.connection.jingle.localVideo = new_stream;
self.connection.jingle.localStreams = [];
- if(RTC.browser == "chrome")
+
+ //in firefox we have only one stream object
+ if(self.connection.jingle.localAudio != self.connection.jingle.localVideo)
self.connection.jingle.localStreams.push(self.connection.jingle.localAudio);
self.connection.jingle.localStreams.push(self.connection.jingle.localVideo);
diff --git a/videolayout.js b/videolayout.js
index f8f64bb959..d9dcff44e2 100644
--- a/videolayout.js
+++ b/videolayout.js
@@ -11,15 +11,16 @@ var VideoLayout = (function (my) {
my.connectionIndicators = {};
- my.changeLocalAudio = function(stream) {
+ my.changeLocalStream = function (stream) {
connection.jingle.localAudio = stream;
- if(RTC.browser == "chrome")
- {
- RTC.attachMediaStream($('#localAudio'), stream);
- document.getElementById('localAudio').autoplay = true;
- document.getElementById('localAudio').volume = 0;
- }
+ VideoLayout.changeLocalVideo(stream, true);
+ }
+ my.changeLocalAudio = function(stream) {
+ connection.jingle.localAudio = stream;
+ RTC.attachMediaStream($('#localAudio'), stream);
+ document.getElementById('localAudio').autoplay = true;
+ document.getElementById('localAudio').volume = 0;
};
my.changeLocalVideo = function(stream, flipX) {