Bladeren bron

Fixes returning to dominant speaker after closing shared video. Renames a method and fix its behaviour was handling both case when removing just video element in small videos (local or remote) and when we are removingParticipantContainer, now just handles the second one and uses focusedID if any or dominantSpeakerID if any, otherwise elects new video.

j8
damencho 9 jaren geleden
bovenliggende
commit
94d98ec0ab

+ 1
- 1
modules/UI/shared_video/SharedVideo.js Bestand weergeven

@@ -383,7 +383,7 @@ SharedVideoThumb.prototype.remove = function () {
383 383
 
384 384
     // Make sure that the large video is updated if are removing its
385 385
     // corresponding small video.
386
-    this.VideoLayout.updateRemovedVideo(this.id);
386
+    this.VideoLayout.updateAfterThumbRemoved(this.id);
387 387
 
388 388
     // Remove whole container
389 389
     if (this.container.parentNode) {

+ 4
- 1
modules/UI/videolayout/LocalVideo.js Bestand weergeven

@@ -191,7 +191,10 @@ LocalVideo.prototype.changeVideo = function (stream) {
191 191
 
192 192
     let endedHandler = () => {
193 193
         localVideoContainer.removeChild(localVideo);
194
-        this.VideoLayout.updateRemovedVideo(this.id);
194
+        // when removing only the video element and we are on stage
195
+        // update the stage
196
+        if(this.VideoLayout.isCurrentlyOnLarge(this.id))
197
+            this.VideoLayout.updateLargeVideo(this.id);
195 198
         stream.off(TrackEvents.LOCAL_TRACK_STOPPED, endedHandler);
196 199
     };
197 200
     stream.on(TrackEvents.LOCAL_TRACK_STOPPED, endedHandler);

+ 5
- 3
modules/UI/videolayout/RemoteVideo.js Bestand weergeven

@@ -156,8 +156,10 @@ RemoteVideo.prototype.removeRemoteStreamElement = function (stream) {
156 156
     console.info((isVideo ? "Video" : "Audio") +
157 157
                  " removed " + this.id, select);
158 158
 
159
-    if (isVideo)
160
-        this.VideoLayout.updateRemovedVideo(this.id);
159
+    // when removing only the video element and we are on stage
160
+    // update the stage
161
+    if (isVideo && this.VideoLayout.isCurrentlyOnLarge(this.id))
162
+        this.VideoLayout.updateLargeVideo(this.id);
161 163
 };
162 164
 
163 165
 /**
@@ -168,7 +170,7 @@ RemoteVideo.prototype.remove = function () {
168 170
     this.removeConnectionIndicator();
169 171
     // Make sure that the large video is updated if are removing its
170 172
     // corresponding small video.
171
-    this.VideoLayout.updateRemovedVideo(this.id);
173
+    this.VideoLayout.updateAfterThumbRemoved(this.id);
172 174
     // Remove whole container
173 175
     if (this.container.parentNode) {
174 176
         this.container.parentNode.removeChild(this.container);

+ 9
- 10
modules/UI/videolayout/VideoLayout.js Bestand weergeven

@@ -199,21 +199,21 @@ var VideoLayout = {
199 199
     /**
200 200
      * Checks if removed video is currently displayed and tries to display
201 201
      * another one instead.
202
+     * Uses focusedID if any or dominantSpeakerID if any,
203
+     * otherwise elects new video, in this order.
202 204
      */
203
-    updateRemovedVideo (id) {
205
+    updateAfterThumbRemoved (id) {
204 206
         if (!this.isCurrentlyOnLarge(id)) {
205 207
             return;
206 208
         }
207 209
 
208 210
         let newId;
209 211
 
210
-        // We'll show user's avatar if he is the dominant speaker or if
211
-        // his video thumbnail is pinned
212
-        if (remoteVideos[id] && (id === pinnedId
213
-                                || id === currentDominantSpeaker)) {
214
-            newId = id;
215
-        } else {
216
-            // Otherwise select last visible video
212
+        if (pinnedId)
213
+            newId = pinnedId;
214
+        else if (currentDominantSpeaker)
215
+            newId = currentDominantSpeaker;
216
+        else // Otherwise select last visible video
217 217
             newId = this.electLastVisibleVideo();
218 218
         }
219 219
 
@@ -304,8 +304,7 @@ var VideoLayout = {
304 304
      */
305 305
     handleVideoThumbClicked (id) {
306 306
         if(pinnedId) {
307
-            var oldSmallVideo
308
-                    = VideoLayout.getSmallVideo(pinnedId);
307
+            var oldSmallVideo = VideoLayout.getSmallVideo(pinnedId);
309 308
             if (oldSmallVideo && !interfaceConfig.filmStripOnly)
310 309
                 oldSmallVideo.focus(false);
311 310
         }

Laden…
Annuleren
Opslaan