fix(large-video): vertically align center screenshare

Stop using special case logic for aligning screenshare videos.
It may be possible to have positioning all done using CSS but that
seems to be a more significant refactoring.
This commit is contained in:
Leonard Kim 2019-05-08 11:00:02 -07:00 committed by virtuacoplenny
parent dcf31baf3a
commit a9d76a2577
1 changed files with 6 additions and 22 deletions

View File

@ -166,22 +166,6 @@ function getCameraVideoPosition( // eslint-disable-line max-params
verticalIndent };
}
/**
* Returns an array of the video horizontal and vertical indents.
* Centers horizontally and top aligns vertically.
*
* @return an array with 2 elements, the horizontal indent and the vertical
* indent
*/
function getDesktopVideoPosition(videoWidth, videoHeight, videoSpaceWidth) {
const horizontalIndent = (videoSpaceWidth - videoWidth) / 2;
const verticalIndent = 0;// Top aligned
return { horizontalIndent,
verticalIndent };
}
/**
* Container for user video.
*/
@ -366,23 +350,23 @@ export class VideoContainer extends LargeContainer {
* @returns {{horizontalIndent, verticalIndent}}
*/
getVideoPosition(width, height, containerWidth, containerHeight) {
let containerWidthToUse = containerWidth;
/* eslint-enable max-params */
if (this.stream && this.isScreenSharing()) {
let availableContainerWidth = containerWidth;
if (interfaceConfig.VERTICAL_FILMSTRIP) {
availableContainerWidth -= Filmstrip.getFilmstripWidth();
containerWidthToUse -= Filmstrip.getFilmstripWidth();
}
return getDesktopVideoPosition(width,
return getCameraVideoPosition(width,
height,
availableContainerWidth,
containerWidthToUse,
containerHeight);
}
return getCameraVideoPosition(width,
height,
containerWidth,
containerWidthToUse,
containerHeight);
}