Skip to content

Commit

Permalink
Fixes a problem not showing remote video menu in case of all moderato…
Browse files Browse the repository at this point in the history
…rs. (jitsi#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().
  • Loading branch information
damencho authored and virtuacoplenny committed Nov 2, 2017
1 parent 922bbb1 commit 90070d9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
12 changes: 5 additions & 7 deletions modules/UI/videolayout/RemoteVideo.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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();
};
Expand Down Expand Up @@ -343,8 +344,6 @@ RemoteVideo.prototype.addRemoteVideoMenu = function() {
}

this._generatePopupContent();

this.hasRemoteVideoMenu = true;
};

/**
Expand Down Expand Up @@ -641,7 +640,6 @@ RemoteVideo.prototype.removeRemoteVideoMenu = function() {
if (menuSpan.length) {
ReactDOM.unmountComponentAtNode(menuSpan.get(0));
menuSpan.remove();
this.hasRemoteVideoMenu = false;
}
};

Expand Down
7 changes: 1 addition & 6 deletions modules/UI/videolayout/VideoLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
},

Expand Down

0 comments on commit 90070d9

Please sign in to comment.