From dafcde50607dc3eacc607fb0d895447d3ace130c Mon Sep 17 00:00:00 2001 From: Leonard Kim Date: Tue, 4 Sep 2018 09:26:24 -0700 Subject: [PATCH] ref(video-layout): remove instance variable for gating show/hide The instance variable is not accurate. By default isVisible is set to false but nothing sets the video container to actually not be visible. As such it is possible for the video element itself to autoplay, thereby making video visible, while the isVisible boolean is still false. The fix chosen is to remove instance variable and always respect calls to show/hide so that the video container can be set to hidden. --- modules/UI/videolayout/VideoContainer.js | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/modules/UI/videolayout/VideoContainer.js b/modules/UI/videolayout/VideoContainer.js index 87aef816da..b5e3b189b8 100644 --- a/modules/UI/videolayout/VideoContainer.js +++ b/modules/UI/videolayout/VideoContainer.js @@ -216,8 +216,6 @@ export class VideoContainer extends LargeContainer { this.emitter = emitter; this.resizeContainer = resizeContainer; - this.isVisible = false; - /** * Whether the background should fit the height of the container * (portrait) or fit the width of the container (landscape). @@ -603,17 +601,11 @@ export class VideoContainer extends LargeContainer { * TODO: refactor this since Temasys is no longer supported. */ show() { - // its already visible - if (this.isVisible) { - return Promise.resolve(); - } - return new Promise(resolve => { this.$wrapperParent.css('visibility', 'visible').fadeTo( FADE_DURATION_MS, 1, () => { - this.isVisible = true; resolve(); } ); @@ -628,15 +620,9 @@ export class VideoContainer extends LargeContainer { // hide its avatar this.showAvatar(false); - // its already hidden - if (!this.isVisible) { - return Promise.resolve(); - } - return new Promise(resolve => { this.$wrapperParent.fadeTo(FADE_DURATION_MS, 0, () => { this.$wrapperParent.css('visibility', 'hidden'); - this.isVisible = false; resolve(); }); });