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
Fixes video mute when the user is alone in the room.
hristoterezov44e558e5a041
diff --git a/index.html b/index.htmlindex b97a9c81e4..ff08283919 100644--- a/index.html+++ b/index.html@@ -19,7 +19,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=39"></script>+ <script src="libs/app.bundle.js?v=40"></script><script src="analytics.js?v=1"></script><!-- google analytics plugin --><link rel="stylesheet" href="css/font.css?v=6"/><link rel="stylesheet" href="css/toastr.css?v=1">diff --git a/libs/app.bundle.js b/libs/app.bundle.jsindex f2acf92481..f8b5b1123e 100644--- a/libs/app.bundle.js+++ b/libs/app.bundle.js@@ -1937,8 +1937,6 @@ UI.getRoomName = function () {* Mutes/unmutes the local video.*/UI.toggleVideo = function () {- UIUtil.buttonClick("#video", "icon-camera icon-camera-disabled");-setVideoMute(!APP.RTC.localVideo.isMuted());};@@ -8295,7 +8293,7 @@ var VideoLayout = (function (my) {*/$(document).bind('videomuted.muc', function (event, jid, value) {var isMuted = (value === "true");- if(!APP.RTC.muteRemoteVideoStream(jid, isMuted))+ if(jid !== APP.xmpp.myJid() && !APP.RTC.muteRemoteVideoStream(jid, isMuted))return;Avatar.showUserAvatar(jid, isMuted);@@ -13177,30 +13175,9 @@ JingleSession.prototype.setVideoMute = function (mute, callback, options) {return;}- var self = this;- var localCallback = function (mute) {- self.connection.emuc.addVideoInfoToPresence(mute);- self.connection.emuc.sendPresence();- return callback(mute)- };-- if (mute == APP.RTC.localVideo.isMuted())- {- // Even if no change occurs, the specified callback is to be executed.- // The specified callback may, optionally, return a successCallback- // which is to be executed as well.- var successCallback = localCallback(mute);-- if (successCallback) {- successCallback();- }- } else {- APP.RTC.localVideo.setMute(!mute);-- this.hardMuteVideo(mute);+ this.hardMuteVideo(mute);- this.modifySources(localCallback(mute));- }+ this.modifySources(callback(mute));};// SDP-based mute by going recvonly/sendrecv@@ -16933,10 +16910,37 @@ var XMPP = {}},setVideoMute: function (mute, callback, options) {- if(connection && APP.RTC.localVideo && connection.jingle.activecall)- {- connection.jingle.activecall.setVideoMute(mute, callback, options);- }+ if(!connection || !APP.RTC.localVideo)+ return;++ var localCallback = function (mute) {+ connection.emuc.addVideoInfoToPresence(mute);+ connection.emuc.sendPresence();+ return callback(mute);+ };++ if (mute == APP.RTC.localVideo.isMuted())+ {+ // Even if no change occurs, the specified callback is to be executed.+ // The specified callback may, optionally, return a successCallback+ // which is to be executed as well.+ var successCallback = localCallback(mute);++ if (successCallback) {+ successCallback();+ }+ } else {+ APP.RTC.localVideo.setMute(!mute);+ if(connection.jingle.activecall)+ {+ connection.jingle.activecall.setVideoMute(+ mute, localCallback, options);+ }+ else {+ localCallback(mute);+ }++ }},setAudioMute: function (mute, callback) {if (!(connection && APP.RTC.localAudio)) {diff --git a/modules/UI/UI.js b/modules/UI/UI.jsindex 11627ee314..9138d6cdd6 100644--- a/modules/UI/UI.js+++ b/modules/UI/UI.js@@ -694,8 +694,6 @@ UI.getRoomName = function () {* Mutes/unmutes the local video.*/UI.toggleVideo = function () {- UIUtil.buttonClick("#video", "icon-camera icon-camera-disabled");-setVideoMute(!APP.RTC.localVideo.isMuted());};diff --git a/modules/UI/videolayout/VideoLayout.js b/modules/UI/videolayout/VideoLayout.jsindex 68f63ff079..d6dffadee1 100644--- a/modules/UI/videolayout/VideoLayout.js+++ b/modules/UI/videolayout/VideoLayout.js@@ -1787,7 +1787,7 @@ var VideoLayout = (function (my) {*/$(document).bind('videomuted.muc', function (event, jid, value) {var isMuted = (value === "true");- if(!APP.RTC.muteRemoteVideoStream(jid, isMuted))+ if(jid !== APP.xmpp.myJid() && !APP.RTC.muteRemoteVideoStream(jid, isMuted))return;Avatar.showUserAvatar(jid, isMuted);diff --git a/modules/xmpp/JingleSession.js b/modules/xmpp/JingleSession.jsindex 4c4dd5ab94..a605ca5e62 100644--- a/modules/xmpp/JingleSession.js+++ b/modules/xmpp/JingleSession.js@@ -1109,30 +1109,9 @@ JingleSession.prototype.setVideoMute = function (mute, callback, options) {return;}- var self = this;- var localCallback = function (mute) {- self.connection.emuc.addVideoInfoToPresence(mute);- self.connection.emuc.sendPresence();- return callback(mute)- };-- if (mute == APP.RTC.localVideo.isMuted())- {- // Even if no change occurs, the specified callback is to be executed.- // The specified callback may, optionally, return a successCallback- // which is to be executed as well.- var successCallback = localCallback(mute);-- if (successCallback) {- successCallback();- }- } else {- APP.RTC.localVideo.setMute(!mute);+ this.hardMuteVideo(mute);- this.hardMuteVideo(mute);-- this.modifySources(localCallback(mute));- }+ this.modifySources(callback(mute));};// SDP-based mute by going recvonly/sendrecvdiff --git a/modules/xmpp/xmpp.js b/modules/xmpp/xmpp.jsindex 2a93b60622..a84f131816 100644--- a/modules/xmpp/xmpp.js+++ b/modules/xmpp/xmpp.js@@ -252,10 +252,37 @@ var XMPP = {}},setVideoMute: function (mute, callback, options) {- if(connection && APP.RTC.localVideo && connection.jingle.activecall)- {- connection.jingle.activecall.setVideoMute(mute, callback, options);- }+ if(!connection || !APP.RTC.localVideo)+ return;++ var localCallback = function (mute) {+ connection.emuc.addVideoInfoToPresence(mute);+ connection.emuc.sendPresence();+ return callback(mute);+ };++ if (mute == APP.RTC.localVideo.isMuted())+ {+ // Even if no change occurs, the specified callback is to be executed.+ // The specified callback may, optionally, return a successCallback+ // which is to be executed as well.+ var successCallback = localCallback(mute);++ if (successCallback) {+ successCallback();+ }+ } else {+ APP.RTC.localVideo.setMute(!mute);+ if(connection.jingle.activecall)+ {+ connection.jingle.activecall.setVideoMute(+ mute, localCallback, options);+ }+ else {+ localCallback(mute);+ }++ }},setAudioMute: function (mute, callback) {if (!(connection && APP.RTC.localAudio)) {