浏览代码

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.
master
Leonard Kim 7 年前
父节点
当前提交
dafcde5060
共有 1 个文件被更改,包括 0 次插入14 次删除
  1. 0
    14
      modules/UI/videolayout/VideoContainer.js

+ 0
- 14
modules/UI/videolayout/VideoContainer.js 查看文件

216
         this.emitter = emitter;
216
         this.emitter = emitter;
217
         this.resizeContainer = resizeContainer;
217
         this.resizeContainer = resizeContainer;
218
 
218
 
219
-        this.isVisible = false;
220
-
221
         /**
219
         /**
222
          * Whether the background should fit the height of the container
220
          * Whether the background should fit the height of the container
223
          * (portrait) or fit the width of the container (landscape).
221
          * (portrait) or fit the width of the container (landscape).
603
      * TODO: refactor this since Temasys is no longer supported.
601
      * TODO: refactor this since Temasys is no longer supported.
604
      */
602
      */
605
     show() {
603
     show() {
606
-        // its already visible
607
-        if (this.isVisible) {
608
-            return Promise.resolve();
609
-        }
610
-
611
         return new Promise(resolve => {
604
         return new Promise(resolve => {
612
             this.$wrapperParent.css('visibility', 'visible').fadeTo(
605
             this.$wrapperParent.css('visibility', 'visible').fadeTo(
613
                 FADE_DURATION_MS,
606
                 FADE_DURATION_MS,
614
                 1,
607
                 1,
615
                 () => {
608
                 () => {
616
-                    this.isVisible = true;
617
                     resolve();
609
                     resolve();
618
                 }
610
                 }
619
             );
611
             );
628
         // hide its avatar
620
         // hide its avatar
629
         this.showAvatar(false);
621
         this.showAvatar(false);
630
 
622
 
631
-        // its already hidden
632
-        if (!this.isVisible) {
633
-            return Promise.resolve();
634
-        }
635
-
636
         return new Promise(resolve => {
623
         return new Promise(resolve => {
637
             this.$wrapperParent.fadeTo(FADE_DURATION_MS, 0, () => {
624
             this.$wrapperParent.fadeTo(FADE_DURATION_MS, 0, () => {
638
                 this.$wrapperParent.css('visibility', 'hidden');
625
                 this.$wrapperParent.css('visibility', 'hidden');
639
-                this.isVisible = false;
640
                 resolve();
626
                 resolve();
641
             });
627
             });
642
         });
628
         });

正在加载...
取消
保存