Browse Source

fix(tile-view): prevent local participant being selected on pin exit

On tile view enter/exit, local video is moved in the DOM (an effect
of not being reactified and moving being easier) and play is called
on its video element. The race condition setup is such: in tile
view with other participants and local video is on large (not
visible in the UI but visible in the app state and pip popout).
The race is such: pin a remote video, large video update is queued,
tile view is exited, local video is moved, play is called,,
onVideoPlaying callback executed, middleware fires mute update,
which checks if local is on large (it is), previous large video
update is cleared, and local is placed on large.

The fix is ensuring the redux representation of local video is
passed in, which holds the boolean videoStarted, which prevents
the onVideoPlaying callback from firing on subsequent plays.
master
Leonard Kim 6 years ago
parent
commit
001e8fe0a7
1 changed files with 4 additions and 1 deletions
  1. 4
    1
      modules/UI/videolayout/LocalVideo.js

+ 4
- 1
modules/UI/videolayout/LocalVideo.js View File

@@ -11,6 +11,7 @@ import {
11 11
     getAvatarURLByParticipantId
12 12
 } from '../../../react/features/base/participants';
13 13
 import { updateSettings } from '../../../react/features/base/settings';
14
+import { getLocalVideoTrack } from '../../../react/features/base/tracks';
14 15
 import { shouldDisplayTileView } from '../../../react/features/video-layout';
15 16
 /* eslint-enable no-unused-vars */
16 17
 
@@ -292,12 +293,14 @@ LocalVideo.prototype._onContainerClick = function(event) {
292 293
  */
293 294
 LocalVideo.prototype._updateVideoElement = function() {
294 295
     const localVideoContainer = document.getElementById('localVideoWrapper');
296
+    const videoTrack
297
+        = getLocalVideoTrack(APP.store.getState()['features/base/tracks']);
295 298
 
296 299
     ReactDOM.render(
297 300
         <Provider store = { APP.store }>
298 301
             <VideoTrack
299 302
                 id = 'localVideo_container'
300
-                videoTrack = {{ jitsiTrack: this.videoStream }} />
303
+                videoTrack = { videoTrack } />
301 304
         </Provider>,
302 305
         localVideoContainer
303 306
     );

Loading…
Cancel
Save