浏览代码

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

j8
Leonard Kim 7 年前
父节点
当前提交
1e3dc20b44

+ 5
- 1
conference.js 查看文件

1713
             APP.store.dispatch(participantLeft(id, room));
1713
             APP.store.dispatch(participantLeft(id, room));
1714
             logger.log('USER %s LEFT', id, user);
1714
             logger.log('USER %s LEFT', id, user);
1715
             APP.API.notifyUserLeft(id);
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
             APP.UI.onSharedVideoStop(id);
1721
             APP.UI.onSharedVideoStop(id);
1718
         });
1722
         });
1719
 
1723
 

+ 0
- 12
modules/UI/UI.js 查看文件

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
  * Update videotype for specified user.
508
  * Update videotype for specified user.
521
  * @param {string} id user id
509
  * @param {string} id user id

+ 1
- 3
modules/UI/shared_video/SharedVideo.js 查看文件

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

+ 0
- 4
modules/UI/shared_video/SharedVideoThumb.js 查看文件

68
 SharedVideoThumb.prototype.remove = function() {
68
 SharedVideoThumb.prototype.remove = function() {
69
     logger.log('Remove shared video thumb', this.id);
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
     // Remove whole container
71
     // Remove whole container
76
     if (this.container.parentNode) {
72
     if (this.container.parentNode) {
77
         this.container.parentNode.removeChild(this.container);
73
         this.container.parentNode.removeChild(this.container);

+ 0
- 4
modules/UI/videolayout/RemoteVideo.js 查看文件

476
 
476
 
477
     this.removeRemoteVideoMenu();
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
     // Remove whole container
479
     // Remove whole container
484
     if (this.container.parentNode) {
480
     if (this.container.parentNode) {
485
         this.container.parentNode.removeChild(this.container);
481
         this.container.parentNode.removeChild(this.container);

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

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

+ 4
- 0
react/features/video-layout/middleware.web.js 查看文件

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

正在加载...
取消
保存