Преглед изворни кода

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().
j8
Дамян Минков пре 8 година
родитељ
комит
90070d9e9f
2 измењених фајлова са 6 додато и 13 уклоњено
  1. 5
    7
      modules/UI/videolayout/RemoteVideo.js
  2. 1
    6
      modules/UI/videolayout/VideoLayout.js

+ 5
- 7
modules/UI/videolayout/RemoteVideo.js Прегледај датотеку

@@ -41,7 +41,6 @@ function RemoteVideo(user, VideoLayout, emitter) {
41 41
     this.videoSpanId = `participant_${this.id}`;
42 42
     SmallVideo.call(this, VideoLayout);
43 43
     this._audioStreamElement = null;
44
-    this.hasRemoteVideoMenu = false;
45 44
     this._supportsRemoteControl = false;
46 45
     this.statsPopoverLocation = interfaceConfig.VERTICAL_FILMSTRIP
47 46
         ? 'left bottom' : 'top center';
@@ -298,9 +297,11 @@ RemoteVideo.prototype._setAudioVolume = function(newVal) {
298 297
  *
299 298
  * @param isMuted the new muted state to update to
300 299
  */
301
-RemoteVideo.prototype.updateRemoteVideoMenu = function(
302
-        isMuted = this.isAudioMuted) {
303
-    this.isAudioMuted = isMuted;
300
+RemoteVideo.prototype.updateRemoteVideoMenu = function(isMuted) {
301
+
302
+    if (typeof isMuted !== 'undefined') {
303
+        this.isAudioMuted = isMuted;
304
+    }
304 305
 
305 306
     this._generatePopupContent();
306 307
 };
@@ -343,8 +344,6 @@ RemoteVideo.prototype.addRemoteVideoMenu = function() {
343 344
     }
344 345
 
345 346
     this._generatePopupContent();
346
-
347
-    this.hasRemoteVideoMenu = true;
348 347
 };
349 348
 
350 349
 /**
@@ -641,7 +640,6 @@ RemoteVideo.prototype.removeRemoteVideoMenu = function() {
641 640
     if (menuSpan.length) {
642 641
         ReactDOM.unmountComponentAtNode(menuSpan.get(0));
643 642
         menuSpan.remove();
644
-        this.hasRemoteVideoMenu = false;
645 643
     }
646 644
 };
647 645
 

+ 1
- 6
modules/UI/videolayout/VideoLayout.js Прегледај датотеку

@@ -559,12 +559,7 @@ const VideoLayout = {
559 559
                 remoteVideo.addModeratorIndicator();
560 560
             }
561 561
 
562
-            if (isModerator) {
563
-                // We are moderator, but user is not - add menu
564
-                if (!remoteVideo.hasRemoteVideoMenu) {
565
-                    remoteVideo.addRemoteVideoMenu();
566
-                }
567
-            }
562
+            remoteVideo.updateRemoteVideoMenu();
568 563
         });
569 564
     },
570 565
 

Loading…
Откажи
Сачувај