Skip to content

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

Fixes issue with switching to the screen stream before conference starts(when we're still alone in the room).

paweldomas6ec7be09f24b
diff --git a/index.html b/index.html
index 9f7ab9e086..aa08c8e5ec 100644
--- a/index.html
+++ b/index.html
@@ -22,7 +22,7 @@
<script src="libs/popover.js?v=1"></script><!-- bootstrap tooltip lib -->
<script src="libs/toastr.js?v=1"></script><!-- notifications lib -->
<script src="interface_config.js?v=5"></script>
- <script src="libs/app.bundle.js?v=97"></script>
+ <script src="libs/app.bundle.js?v=98"></script>
<script src="analytics.js?v=1"></script><!-- google analytics plugin -->
<link rel="stylesheet" href="css/font.css?v=7"/>
<link rel="stylesheet" href="css/toastr.css?v=1">
diff --git a/libs/app.bundle.js b/libs/app.bundle.js
index 56f8704694..38f230c378 100644
--- a/libs/app.bundle.js
+++ b/libs/app.bundle.js
@@ -1325,6 +1325,9 @@ var RTC = {
this.localVideo = this.createLocalStream(videoStream, "video", true, type);
// Stop the stream to trigger onended event for old stream
oldStream.stop();
+
+ this.switchVideoStreams(videoStream, oldStream);
+
APP.xmpp.switchStreams(videoStream, oldStream,localCallback);
},
changeLocalAudio: function (stream, callback) {
@@ -8591,7 +8594,10 @@ var VideoLayout = (function (my) {
localVideoThumbnail.changeVideo(stream, isMuted);
- LargeVideo.updateLargeVideo(APP.xmpp.myResource());
+ LargeVideo.updateLargeVideo(
+ APP.xmpp.myResource(),
+ /* force update only before conference starts */
+ !APP.xmpp.isConferenceInProgress());
};
@@ -12768,9 +12774,6 @@ JingleSession.prototype.switchStreams = function (new_stream, oldStream, success
self.peerconnection.addStream(new_stream);
}
- if(!isAudio)
- APP.RTC.switchVideoStreams(new_stream, oldStream);
-
// Conference is not active
if(!oldSdp || !self.peerconnection) {
success_callback();
@@ -16846,8 +16849,12 @@ var XMPP = {
isExternalAuthEnabled: function () {
return Moderator.isExternalAuthEnabled();
},
+ isConferenceInProgress: function () {
+ return connection && connection.jingle.activecall &&
+ connection.jingle.activecall.peerconnection;
+ },
switchStreams: function (stream, oldStream, callback, isAudio) {
- if (connection && connection.jingle.activecall) {
+ if (this.isConferenceInProgress()) {
// FIXME: will block switchInProgress on true value in case of exception
connection.jingle.activecall.switchStreams(stream, oldStream, callback, isAudio);
} else {
@@ -17085,8 +17092,7 @@ var XMPP = {
return connection.jingle.sessions;
},
removeStream: function (stream) {
- if(!connection || !connection.jingle.activecall ||
- !connection.jingle.activecall.peerconnection)
+ if (!this.isConferenceInProgress())
return;
connection.jingle.activecall.peerconnection.removeStream(stream);
}
diff --git a/modules/RTC/RTC.js b/modules/RTC/RTC.js
index 4f873536b4..1074267e4f 100644
--- a/modules/RTC/RTC.js
+++ b/modules/RTC/RTC.js
@@ -215,6 +215,9 @@ var RTC = {
this.localVideo = this.createLocalStream(videoStream, "video", true, type);
// Stop the stream to trigger onended event for old stream
oldStream.stop();
+
+ this.switchVideoStreams(videoStream, oldStream);
+
APP.xmpp.switchStreams(videoStream, oldStream,localCallback);
},
changeLocalAudio: function (stream, callback) {
diff --git a/modules/UI/videolayout/VideoLayout.js b/modules/UI/videolayout/VideoLayout.js
index 8c70476e9b..a3b5a56dad 100644
--- a/modules/UI/videolayout/VideoLayout.js
+++ b/modules/UI/videolayout/VideoLayout.js
@@ -64,7 +64,10 @@ var VideoLayout = (function (my) {
localVideoThumbnail.changeVideo(stream, isMuted);
- LargeVideo.updateLargeVideo(APP.xmpp.myResource());
+ LargeVideo.updateLargeVideo(
+ APP.xmpp.myResource(),
+ /* force update only before conference starts */
+ !APP.xmpp.isConferenceInProgress());
};
diff --git a/modules/xmpp/JingleSession.js b/modules/xmpp/JingleSession.js
index 99253cf376..5492062556 100644
--- a/modules/xmpp/JingleSession.js
+++ b/modules/xmpp/JingleSession.js
@@ -1020,9 +1020,6 @@ JingleSession.prototype.switchStreams = function (new_stream, oldStream, success
self.peerconnection.addStream(new_stream);
}
- if(!isAudio)
- APP.RTC.switchVideoStreams(new_stream, oldStream);
-
// Conference is not active
if(!oldSdp || !self.peerconnection) {
success_callback();
diff --git a/modules/xmpp/xmpp.js b/modules/xmpp/xmpp.js
index 6587bf5243..3ff7741ed5 100644
--- a/modules/xmpp/xmpp.js
+++ b/modules/xmpp/xmpp.js
@@ -362,8 +362,12 @@ var XMPP = {
isExternalAuthEnabled: function () {
return Moderator.isExternalAuthEnabled();
},
+ isConferenceInProgress: function () {
+ return connection && connection.jingle.activecall &&
+ connection.jingle.activecall.peerconnection;
+ },
switchStreams: function (stream, oldStream, callback, isAudio) {
- if (connection && connection.jingle.activecall) {
+ if (this.isConferenceInProgress()) {
// FIXME: will block switchInProgress on true value in case of exception
connection.jingle.activecall.switchStreams(stream, oldStream, callback, isAudio);
} else {
@@ -601,8 +605,7 @@ var XMPP = {
return connection.jingle.sessions;
},
removeStream: function (stream) {
- if(!connection || !connection.jingle.activecall ||
- !connection.jingle.activecall.peerconnection)
+ if (!this.isConferenceInProgress())
return;
connection.jingle.activecall.peerconnection.removeStream(stream);
}