fix(vertical-filmstrip): prevent shared videos from displaying under avatars

- Modify Etherpad and SharedVideo so their resizing takes into account
  the width of the filmstrip in vertical filmstrip mode.
- Modify Filmstrip's getFilmstripWidth to account for when the filmstrip
  is hidden.
- modify VideoContainer so in vertical filmstrip mode it centers the
  shared desktop stream in the middle of the available space not taken
  by filmstrip.
- Also allow clickthrough on the secondary toolbar itself while still
  allowing clicks on the toolbar's buttons. This allows clicks on
  shared videos to go through.
This commit is contained in:
Leonard Kim 2017-06-14 18:52:59 -05:00 committed by yanas
parent 9ddc5a0e42
commit a653816f90
6 changed files with 56 additions and 9 deletions

View File

@ -186,6 +186,7 @@
justify-content: flex-start; justify-content: flex-start;
left: 0; left: 0;
padding-top: 24px; padding-top: 24px;
pointer-events: none;
top: 0; top: 0;
transform: translateX(-100%); transform: translateX(-100%);
width: $defaultToolbarSize; width: $defaultToolbarSize;
@ -197,6 +198,10 @@
line-height: $secToolbarLineHeight; line-height: $secToolbarLineHeight;
} }
> * {
pointer-events: auto
}
.button.toggled:not(.icon-raised-hand):not(.button-active) { .button.toggled:not(.icon-raised-hand):not(.button-active) {
background: $secondaryToolbarBg; background: $secondaryToolbarBg;
cursor: pointer; cursor: pointer;

View File

@ -14,6 +14,11 @@
min-width: 0; min-width: 0;
} }
#etherpad,
#sharedvideo {
text-align: left;
}
.filmstrip { .filmstrip {
align-items: flex-end; align-items: flex-end;
box-sizing: border-box; box-sizing: border-box;

View File

@ -1,4 +1,4 @@
/* global $ */ /* global $, interfaceConfig */
import VideoLayout from '../videolayout/VideoLayout'; import VideoLayout from '../videolayout/VideoLayout';
import LargeContainer from '../videolayout/LargeContainer'; import LargeContainer from '../videolayout/LargeContainer';
@ -123,8 +123,15 @@ class Etherpad extends LargeContainer {
* *
*/ */
resize(containerWidth, containerHeight) { resize(containerWidth, containerHeight) {
const height = containerHeight - Filmstrip.getFilmstripHeight(); let height, width;
const width = containerWidth;
if (interfaceConfig.VERTICAL_FILMSTRIP) {
height = containerHeight;
width = containerWidth - Filmstrip.getFilmstripWidth();
} else {
height = containerHeight - Filmstrip.getFilmstripHeight();
width = containerWidth;
}
$(this.iframe) $(this.iframe)
.width(width) .width(width)

View File

@ -1,4 +1,6 @@
/* global $, APP, YT, onPlayerReady, onPlayerStateChange, onPlayerError */ /* global $, APP, YT, interfaceConfig, onPlayerReady, onPlayerStateChange,
onPlayerError */
const logger = require('jitsi-meet-logger').getLogger(__filename); const logger = require('jitsi-meet-logger').getLogger(__filename);
import UIUtil from '../util/UIUtil'; import UIUtil from '../util/UIUtil';
@ -681,9 +683,15 @@ class SharedVideoContainer extends LargeContainer {
* *
*/ */
resize(containerWidth, containerHeight) { resize(containerWidth, containerHeight) {
const height = containerHeight - Filmstrip.getFilmstripHeight(); let height, width;
const width = containerWidth; if (interfaceConfig.VERTICAL_FILMSTRIP) {
height = containerHeight;
width = containerWidth - Filmstrip.getFilmstripWidth();
} else {
height = containerHeight - Filmstrip.getFilmstripHeight();
width = containerWidth;
}
this.$iframe.width(width).height(height); this.$iframe.width(width).height(height);
} }

View File

@ -200,7 +200,18 @@ const Filmstrip = {
} }
return 0; return 0;
},
/**
* Returns the width of filmstip
* @returns {number} width
*/
getFilmstripWidth() {
return this.isFilmstripVisible()
? this.filmstrip.outerWidth()
- parseInt(this.filmstrip.css('paddingLeft'), 10)
- parseInt(this.filmstrip.css('paddingRight'), 10)
: 0;
}, },
/** /**

View File

@ -33,8 +33,13 @@ function computeDesktopVideoSize( // eslint-disable-line max-params
let availableWidth = Math.max(videoWidth, videoSpaceWidth); let availableWidth = Math.max(videoWidth, videoSpaceWidth);
let availableHeight = Math.max(videoHeight, videoSpaceHeight); let availableHeight = Math.max(videoHeight, videoSpaceHeight);
// eslint-disable-next-line no-param-reassign if (interfaceConfig.VERTICAL_FILMSTRIP) {
videoSpaceHeight -= Filmstrip.getFilmstripHeight(); // eslint-disable-next-line no-param-reassign
videoSpaceWidth -= Filmstrip.getFilmstripWidth();
} else {
// eslint-disable-next-line no-param-reassign
videoSpaceHeight -= Filmstrip.getFilmstripHeight();
}
if (availableWidth / aspectRatio >= videoSpaceHeight) { if (availableWidth / aspectRatio >= videoSpaceHeight) {
availableHeight = videoSpaceHeight; availableHeight = videoSpaceHeight;
@ -334,9 +339,15 @@ export class VideoContainer extends LargeContainer {
getVideoPosition(width, height, containerWidth, containerHeight) { getVideoPosition(width, height, containerWidth, containerHeight) {
/* eslint-enable max-params */ /* eslint-enable max-params */
if (this.stream && this.isScreenSharing()) { if (this.stream && this.isScreenSharing()) {
let availableContainerWidth = containerWidth;
if (interfaceConfig.VERTICAL_FILMSTRIP) {
availableContainerWidth -= Filmstrip.getFilmstripWidth();
}
return getDesktopVideoPosition(width, return getDesktopVideoPosition(width,
height, height,
containerWidth, availableContainerWidth,
containerHeight); containerHeight);
} }