diff --git a/index.html b/index.html
index b97a9c81e..ff0828391 100644
--- a/index.html
+++ b/index.html
@@ -19,7 +19,7 @@
-
+
diff --git a/libs/app.bundle.js b/libs/app.bundle.js
index f2acf9248..f8b5b1123 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)
- };
+ this.hardMuteVideo(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.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.js
index 11627ee31..9138d6cdd 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.js
index 68f63ff07..d6dffadee 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.js
index 4c4dd5ab9..a605ca5e6 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)
- };
+ this.hardMuteVideo(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.modifySources(localCallback(mute));
- }
+ this.modifySources(callback(mute));
};
// SDP-based mute by going recvonly/sendrecv
diff --git a/modules/xmpp/xmpp.js b/modules/xmpp/xmpp.js
index 2a93b6062..a84f13181 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)) {