From c6e5adbe0ef6092fcb9b2eb69ca6a5b8f5c2ff45 Mon Sep 17 00:00:00 2001 From: virtuacoplenny Date: Wed, 10 Apr 2019 08:16:02 -0700 Subject: [PATCH] fix(large-video): respect update in progress when queuing update (#4078) When a fade in/out animation is in progress, another large video update can be queued but can try to force itself onto large video. For example a pin can be in progress and while the fade in/out animation plays, local video can change its video type during the animation and forcing an update of large video. This results in local video getting forcible updated onto large video while the pinned video is left on small video only. --- modules/UI/videolayout/LargeVideoManager.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/UI/videolayout/LargeVideoManager.js b/modules/UI/videolayout/LargeVideoManager.js index 769d0fa93..5c350ef82 100644 --- a/modules/UI/videolayout/LargeVideoManager.js +++ b/modules/UI/videolayout/LargeVideoManager.js @@ -168,6 +168,13 @@ export default class LargeVideoManager { get id() { const container = this.getCurrentContainer(); + // If a user switch for large video is in progress then provide what + // will be the end result of the update. + if (this.updateInProcess + && this.newStreamData + && this.newStreamData.id !== container.id) { + return this.newStreamData.id; + } return container.id; } @@ -184,8 +191,8 @@ export default class LargeVideoManager { // Include hide()/fadeOut only if we're switching between users // eslint-disable-next-line eqeqeq - const isUserSwitch = this.newStreamData.id != this.id; const container = this.getCurrentContainer(); + const isUserSwitch = this.newStreamData.id !== container.id; const preUpdate = isUserSwitch ? container.hide() : Promise.resolve(); preUpdate.then(() => {