浏览代码

Fixes muting particular remote participant.

There was a bug that the handlers for menuItem for mute and kick are added for all remote participants. When clicked multiple handlers are executed and the action will be executed for all remote participants.
master
damencho 9 年前
父节点
当前提交
246ab88a3e
共有 2 个文件被更改,包括 8 次插入4 次删除
  1. 7
    3
      modules/UI/videolayout/RemoteVideo.js
  2. 1
    1
      modules/UI/videolayout/VideoLayout.js

+ 7
- 3
modules/UI/videolayout/RemoteVideo.js 查看文件

13
     this.emitter = emitter;
13
     this.emitter = emitter;
14
     this.videoSpanId = `participant_${id}`;
14
     this.videoSpanId = `participant_${id}`;
15
     SmallVideo.call(this, VideoLayout);
15
     SmallVideo.call(this, VideoLayout);
16
+    this.hasRemoteVideoMenu = false;
16
     this.addRemoteVideoContainer();
17
     this.addRemoteVideoContainer();
17
     this.connectionIndicator = new ConnectionIndicator(this, id);
18
     this.connectionIndicator = new ConnectionIndicator(this, id);
18
     this.setDisplayName();
19
     this.setDisplayName();
93
         APP.translation.translateString("videothumbnail.muted") +
94
         APP.translation.translateString("videothumbnail.muted") +
94
         "</div>";
95
         "</div>";
95
 
96
 
96
-    muteLinkItem.id = "muteLinkItem";
97
+    muteLinkItem.id = "mutelink_" + this.id;
97
 
98
 
98
     if (this.isMuted) {
99
     if (this.isMuted) {
99
         muteLinkItem.innerHTML = mutedHTML;
100
         muteLinkItem.innerHTML = mutedHTML;
105
     }
106
     }
106
 
107
 
107
     // Delegate event to the document.
108
     // Delegate event to the document.
108
-    $(document).on("click", ".mutelink", function(){
109
+    $(document).on("click", "#mutelink_" + this.id, function(){
109
 
110
 
110
         if (this.isMuted)
111
         if (this.isMuted)
111
             return;
112
             return;
130
 
131
 
131
     ejectLinkItem.className = 'ejectlink';
132
     ejectLinkItem.className = 'ejectlink';
132
     ejectLinkItem.innerHTML = ejectIndicator + ' ' + ejectText;
133
     ejectLinkItem.innerHTML = ejectIndicator + ' ' + ejectText;
134
+    ejectLinkItem.id = "ejectlink_" + this.id;
133
 
135
 
134
-    $(document).on("click", ".ejectlink", function(){
136
+    $(document).on("click", "#ejectlink_" + this.id, function(){
135
         this.emitter.emit(UIEvents.USER_KICKED, this.id);
137
         this.emitter.emit(UIEvents.USER_KICKED, this.id);
136
         this.popover.forceHide();
138
         this.popover.forceHide();
137
     }.bind(this));
139
     }.bind(this));
178
         spanElement.appendChild(menuElement);
180
         spanElement.appendChild(menuElement);
179
 
181
 
180
         this._initPopupMenu(this._generatePopupContent());
182
         this._initPopupMenu(this._generatePopupContent());
183
+        this.hasRemoteVideoMenu = true;
181
     };
184
     };
182
 
185
 
183
 } else {
186
 } else {
419
     if (menuSpan.length) {
422
     if (menuSpan.length) {
420
         this.popover.forceHide();
423
         this.popover.forceHide();
421
         menuSpan.remove();
424
         menuSpan.remove();
425
+        this.hasRemoteVideoMenu = false;
422
     }
426
     }
423
 };
427
 };
424
 
428
 

+ 1
- 1
modules/UI/videolayout/VideoLayout.js 查看文件

472
                 remoteVideo.createModeratorIndicatorElement();
472
                 remoteVideo.createModeratorIndicatorElement();
473
             } else if (isModerator) {
473
             } else if (isModerator) {
474
                 // We are moderator, but user is not - add menu
474
                 // We are moderator, but user is not - add menu
475
-                if ($(`#remote_popupmenu_${id}`).length <= 0) {
475
+                if(!remoteVideo.hasRemoteVideoMenu) {
476
                     remoteVideo.addRemoteVideoMenu();
476
                     remoteVideo.addRemoteVideoMenu();
477
                 }
477
                 }
478
             }
478
             }

正在加载...
取消
保存