Просмотр исходного кода

fix(video-layout): contact list click behaves like thumbnail click

Checks exist when clicking a contact list to prevent the pinning
UI from updating if a remote thumbnail has not loaded video.
This was unexpected UX so instead go ahead and pin. This is
accomplished by having contact list clicks to more directly
trigger the flow of a thumbnail being clicked.
master
Leonard Kim 8 лет назад
Родитель
Сommit
95fcc7702f
1 измененных файлов: 3 добавлений и 39 удалений
  1. 3
    39
      modules/UI/videolayout/VideoLayout.js

+ 3
- 39
modules/UI/videolayout/VideoLayout.js Просмотреть файл

@@ -79,7 +79,7 @@ const VideoLayout = {
79 79
         // the local video thumb maybe one pixel
80 80
         this.resizeThumbnails(false, true);
81 81
 
82
-        this._onContactClicked = onContactClicked.bind(this);
82
+        this.handleVideoThumbClicked = this.handleVideoThumbClicked.bind(this);
83 83
 
84 84
         this.registerListeners();
85 85
     },
@@ -105,7 +105,7 @@ const VideoLayout = {
105 105
         eventEmitter.addListener(UIEvents.LOCAL_FLIPX_CHANGED,
106 106
             onLocalFlipXChanged);
107 107
         eventEmitter.addListener(UIEvents.CONTACT_CLICKED,
108
-            this._onContactClicked);
108
+            this.handleVideoThumbClicked);
109 109
     },
110 110
 
111 111
     /**
@@ -116,7 +116,7 @@ const VideoLayout = {
116 116
     unregisterListeners() {
117 117
         if (this._onContactClicked) {
118 118
             eventEmitter.removeListener(UIEvents.CONTACT_CLICKED,
119
-                this._onContactClicked);
119
+                this.handleVideoThumbClicked);
120 120
         }
121 121
     },
122 122
 
@@ -1206,40 +1206,4 @@ const VideoLayout = {
1206 1206
     }
1207 1207
 };
1208 1208
 
1209
-/**
1210
- * On contact list item clicked.
1211
- */
1212
-function onContactClicked(id) {
1213
-    if (APP.conference.isLocalId(id)) {
1214
-        $('#localVideoContainer').click();
1215
-
1216
-        return;
1217
-    }
1218
-
1219
-    const remoteVideo = remoteVideos[id];
1220
-
1221
-    if (remoteVideo && remoteVideo.hasVideo()) {
1222
-        // It is not always the case that a videoThumb exists (if there is
1223
-        // no actual video).
1224
-        if (remoteVideo.hasVideoStarted()) {
1225
-            // We have a video src, great! Let's update the large video
1226
-            // now.
1227
-            VideoLayout.handleVideoThumbClicked(id);
1228
-        } else {
1229
-
1230
-            // If we don't have a video src for jid, there's absolutely
1231
-            // no point in calling handleVideoThumbClicked; Quite
1232
-            // simply, it won't work because it needs an src to attach
1233
-            // to the large video.
1234
-            //
1235
-            // Instead, we trigger the pinned endpoint changed event to
1236
-            // let the bridge adjust its lastN set for myjid and store
1237
-            // the pinned user in the lastNPickupId variable to be
1238
-            // picked up later by the lastN changed event handler.
1239
-            // eslint-disable-next-line no-invalid-this
1240
-            this.pinParticipant(remoteVideo.id);
1241
-        }
1242
-    }
1243
-}
1244
-
1245 1209
 export default VideoLayout;

Загрузка…
Отмена
Сохранить