Browse Source

ref(video-layout): video layout controls own updating after user leave

j8
Leonard Kim 7 years ago
parent
commit
1e3dc20b44

+ 5
- 1
conference.js View File

@@ -1713,7 +1713,11 @@ export default {
1713 1713
             APP.store.dispatch(participantLeft(id, room));
1714 1714
             logger.log('USER %s LEFT', id, user);
1715 1715
             APP.API.notifyUserLeft(id);
1716
-            APP.UI.removeUser(id, user.getDisplayName());
1716
+            APP.UI.messageHandler.participantNotification(
1717
+                user.getDisplayName(),
1718
+                'notify.somebody',
1719
+                'disconnected',
1720
+                'notify.disconnected');
1717 1721
             APP.UI.onSharedVideoStop(id);
1718 1722
         });
1719 1723
 

+ 0
- 12
modules/UI/UI.js View File

@@ -504,18 +504,6 @@ UI.addUser = function(user) {
504 504
     }
505 505
 };
506 506
 
507
-/**
508
- * Remove user from UI.
509
- * @param {string} id   user id
510
- * @param {string} displayName user nickname
511
- */
512
-UI.removeUser = function(id, displayName) {
513
-    messageHandler.participantNotification(
514
-        displayName, 'notify.somebody', 'disconnected', 'notify.disconnected');
515
-
516
-    VideoLayout.removeParticipantContainer(id);
517
-};
518
-
519 507
 /**
520 508
  * Update videotype for specified user.
521 509
  * @param {string} id user id

+ 1
- 3
modules/UI/shared_video/SharedVideo.js View File

@@ -497,7 +497,7 @@ export default class SharedVideoManager {
497 497
             this.localAudioMutedListener);
498 498
         this.localAudioMutedListener = null;
499 499
 
500
-        VideoLayout.removeParticipantContainer(this.url);
500
+        APP.store.dispatch(participantLeft(this.url, APP.conference._room));
501 501
 
502 502
         VideoLayout.showLargeVideoContainer(SHARED_VIDEO_CONTAINER_TYPE, false)
503 503
             .then(() => {
@@ -522,8 +522,6 @@ export default class SharedVideoManager {
522 522
                     UIEvents.UPDATE_SHARED_VIDEO, null, 'removed');
523 523
             });
524 524
 
525
-        APP.store.dispatch(participantLeft(this.url, APP.conference._room));
526
-
527 525
         this.url = null;
528 526
         this.isSharedVideoShown = false;
529 527
         this.initialAttributes = null;

+ 0
- 4
modules/UI/shared_video/SharedVideoThumb.js View File

@@ -68,10 +68,6 @@ SharedVideoThumb.prototype.videoClick = function() {
68 68
 SharedVideoThumb.prototype.remove = function() {
69 69
     logger.log('Remove shared video thumb', this.id);
70 70
 
71
-    // Make sure that the large video is updated if are removing its
72
-    // corresponding small video.
73
-    this.VideoLayout.updateAfterThumbRemoved(this.id);
74
-
75 71
     // Remove whole container
76 72
     if (this.container.parentNode) {
77 73
         this.container.parentNode.removeChild(this.container);

+ 0
- 4
modules/UI/videolayout/RemoteVideo.js View File

@@ -476,10 +476,6 @@ RemoteVideo.prototype.remove = function() {
476 476
 
477 477
     this.removeRemoteVideoMenu();
478 478
 
479
-    // Make sure that the large video is updated if are removing its
480
-    // corresponding small video.
481
-    this.VideoLayout.updateAfterThumbRemoved(this.id);
482
-
483 479
     // Remove whole container
484 480
     if (this.container.parentNode) {
485 481
         this.container.parentNode.removeChild(this.container);

+ 2
- 1
modules/UI/videolayout/VideoLayout.js View File

@@ -253,7 +253,7 @@ const VideoLayout = {
253 253
      * Uses focusedID if any or dominantSpeakerID if any,
254 254
      * otherwise elects new video, in this order.
255 255
      */
256
-    updateAfterThumbRemoved(id) {
256
+    _updateAfterThumbRemoved(id) {
257 257
         // Always trigger an update if large video is empty.
258 258
         if (!largeVideo
259 259
             || (this.getLargeVideoID() && !this.isCurrentlyOnLarge(id))) {
@@ -804,6 +804,7 @@ const VideoLayout = {
804 804
         }
805 805
 
806 806
         VideoLayout.resizeThumbnails();
807
+        VideoLayout._updateAfterThumbRemoved(id);
807 808
     },
808 809
 
809 810
     onVideoTypeChanged(id, newVideoType) {

+ 4
- 0
react/features/video-layout/middleware.web.js View File

@@ -5,6 +5,7 @@ import UIEvents from '../../../service/UI/UIEvents';
5 5
 
6 6
 import {
7 7
     DOMINANT_SPEAKER_CHANGED,
8
+    PARTICIPANT_LEFT,
8 9
     PARTICIPANT_UPDATED,
9 10
     PIN_PARTICIPANT
10 11
 } from '../base/participants';
@@ -27,6 +28,9 @@ MiddlewareRegistry.register(store => next => action => {
27 28
     const result = next(action);
28 29
 
29 30
     switch (action.type) {
31
+    case PARTICIPANT_LEFT:
32
+        VideoLayout.removeParticipantContainer(action.participant.id);
33
+        break;
30 34
 
31 35
     case PARTICIPANT_UPDATED: {
32 36
         // Look for actions that triggered a change to connectionStatus. This is

Loading…
Cancel
Save