Browse Source

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 years ago
parent
commit
95fcc7702f
1 changed files with 3 additions and 39 deletions
  1. 3
    39
      modules/UI/videolayout/VideoLayout.js

+ 3
- 39
modules/UI/videolayout/VideoLayout.js View File

79
         // the local video thumb maybe one pixel
79
         // the local video thumb maybe one pixel
80
         this.resizeThumbnails(false, true);
80
         this.resizeThumbnails(false, true);
81
 
81
 
82
-        this._onContactClicked = onContactClicked.bind(this);
82
+        this.handleVideoThumbClicked = this.handleVideoThumbClicked.bind(this);
83
 
83
 
84
         this.registerListeners();
84
         this.registerListeners();
85
     },
85
     },
105
         eventEmitter.addListener(UIEvents.LOCAL_FLIPX_CHANGED,
105
         eventEmitter.addListener(UIEvents.LOCAL_FLIPX_CHANGED,
106
             onLocalFlipXChanged);
106
             onLocalFlipXChanged);
107
         eventEmitter.addListener(UIEvents.CONTACT_CLICKED,
107
         eventEmitter.addListener(UIEvents.CONTACT_CLICKED,
108
-            this._onContactClicked);
108
+            this.handleVideoThumbClicked);
109
     },
109
     },
110
 
110
 
111
     /**
111
     /**
116
     unregisterListeners() {
116
     unregisterListeners() {
117
         if (this._onContactClicked) {
117
         if (this._onContactClicked) {
118
             eventEmitter.removeListener(UIEvents.CONTACT_CLICKED,
118
             eventEmitter.removeListener(UIEvents.CONTACT_CLICKED,
119
-                this._onContactClicked);
119
+                this.handleVideoThumbClicked);
120
         }
120
         }
121
     },
121
     },
122
 
122
 
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
 export default VideoLayout;
1209
 export default VideoLayout;

Loading…
Cancel
Save