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.
This commit is contained in:
Leonard Kim 2018-09-04 09:26:24 -07:00
parent 3b754fa219
commit dafcde5060
1 changed files with 0 additions and 14 deletions

View File

@ -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();
});
});