From 90070d9e9fa3e53f0c024cc94de22c894a1cea75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B0=D0=BC=D1=8F=D0=BD=20=D0=9C=D0=B8=D0=BD=D0=BA?= =?UTF-8?q?=D0=BE=D0=B2?= Date: Thu, 2 Nov 2017 14:07:31 -0500 Subject: [PATCH] Fixes a problem not showing remote video menu in case of all moderators. (#2130) Removes hasRemoteVideoMenu from RemoteVideo. In some cases where mod_muc_allowners is enabled we do not see the remote video menu. The problem was in the order of initialization of remote video component. RemoteVideo#constructor -> Remotevideo#addaddRemoteVideoContainer -> Remotevideo#addRemoteVideoMenu -> RemoteVideo#hasRemoteVideoMenu = true Then in VideoLayout#showModeratorIndicator -> !remoteVideo.hasRemoteVideoMenu -> remoteVideo.addRemoteVideoMenu(). --- modules/UI/videolayout/RemoteVideo.js | 12 +++++------- modules/UI/videolayout/VideoLayout.js | 7 +------ 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/modules/UI/videolayout/RemoteVideo.js b/modules/UI/videolayout/RemoteVideo.js index bda63aba1..36f0db7fb 100644 --- a/modules/UI/videolayout/RemoteVideo.js +++ b/modules/UI/videolayout/RemoteVideo.js @@ -41,7 +41,6 @@ function RemoteVideo(user, VideoLayout, emitter) { this.videoSpanId = `participant_${this.id}`; SmallVideo.call(this, VideoLayout); this._audioStreamElement = null; - this.hasRemoteVideoMenu = false; this._supportsRemoteControl = false; this.statsPopoverLocation = interfaceConfig.VERTICAL_FILMSTRIP ? 'left bottom' : 'top center'; @@ -298,9 +297,11 @@ RemoteVideo.prototype._setAudioVolume = function(newVal) { * * @param isMuted the new muted state to update to */ -RemoteVideo.prototype.updateRemoteVideoMenu = function( - isMuted = this.isAudioMuted) { - this.isAudioMuted = isMuted; +RemoteVideo.prototype.updateRemoteVideoMenu = function(isMuted) { + + if (typeof isMuted !== 'undefined') { + this.isAudioMuted = isMuted; + } this._generatePopupContent(); }; @@ -343,8 +344,6 @@ RemoteVideo.prototype.addRemoteVideoMenu = function() { } this._generatePopupContent(); - - this.hasRemoteVideoMenu = true; }; /** @@ -641,7 +640,6 @@ RemoteVideo.prototype.removeRemoteVideoMenu = function() { if (menuSpan.length) { ReactDOM.unmountComponentAtNode(menuSpan.get(0)); menuSpan.remove(); - this.hasRemoteVideoMenu = false; } }; diff --git a/modules/UI/videolayout/VideoLayout.js b/modules/UI/videolayout/VideoLayout.js index e14fce129..84542a585 100644 --- a/modules/UI/videolayout/VideoLayout.js +++ b/modules/UI/videolayout/VideoLayout.js @@ -559,12 +559,7 @@ const VideoLayout = { remoteVideo.addModeratorIndicator(); } - if (isModerator) { - // We are moderator, but user is not - add menu - if (!remoteVideo.hasRemoteVideoMenu) { - remoteVideo.addRemoteVideoMenu(); - } - } + remoteVideo.updateRemoteVideoMenu(); }); },