Procházet zdrojové kódy

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 před 7 roky
rodič
revize
dafcde5060
1 změnil soubory, kde provedl 0 přidání a 14 odebrání
  1. 0
    14
      modules/UI/videolayout/VideoContainer.js

+ 0
- 14
modules/UI/videolayout/VideoContainer.js Zobrazit soubor

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

Načítá se…
Zrušit
Uložit