Fix webcams bug in screenshare

This commit is contained in:
Vitor Mateus De Almeida 2020-07-06 11:35:11 -03:00
parent cd289a47c3
commit 9a08349b36
2 changed files with 13 additions and 59 deletions

View File

@ -350,7 +350,6 @@ class LayoutManager extends Component {
const autoArrangeLayout = Storage.getItem('autoArrangeLayout');
const webcamsAreaUserSetsHeight = Storage.getItem('webcamsAreaUserSetsHeight');
const webcamsAreaUserSetsWidth = Storage.getItem('webcamsAreaUserSetsWidth');
const isScreenShare = isVideoBroadcasting();
let webcamsAreaWidth;
let webcamsAreaHeight;
@ -362,23 +361,6 @@ class LayoutManager extends Component {
};
}
if (isScreenShare) {
if (webcamsPlacement === 'left' || webcamsPlacement === 'right') {
webcamsAreaWidth = mediaAreaWidth * WEBCAMSAREA_MIN_PERCENT;
webcamsAreaHeight = mediaAreaHeight;
} else {
webcamsAreaWidth = mediaAreaWidth;
webcamsAreaHeight = (mediaAreaHeight - presentationHeight)
< (mediaAreaHeight * WEBCAMSAREA_MIN_PERCENT)
? mediaAreaHeight * WEBCAMSAREA_MIN_PERCENT
: mediaAreaHeight - presentationHeight;
}
return {
webcamsAreaWidth,
webcamsAreaHeight,
};
}
if (autoArrangeLayout) {
if (webcamsPlacement === 'left' || webcamsPlacement === 'right') {
webcamsAreaWidth = (mediaAreaWidth - presentationWidth)
@ -460,23 +442,6 @@ class LayoutManager extends Component {
};
}
calculatesScreenShareAreaSize(
mediaAreaWidth, mediaAreaHeight, webcamAreaWidth, webcamAreaHeight,
) {
const { layoutContextState } = this.props;
const { numUsersVideo } = layoutContextState;
if (numUsersVideo < 1) {
return {
screenShareAreaWidth: mediaAreaWidth,
screenShareAreaHeight: mediaAreaHeight - 20,
};
}
return {
screenShareAreaWidth: mediaAreaWidth,
screenShareAreaHeight: mediaAreaHeight - webcamAreaHeight - 30,
};
}
calculatesLayout(panelChanged = false) {
const {
layoutContextState,
@ -518,8 +483,6 @@ class LayoutManager extends Component {
left: firstPanel.width + secondPanel.width,
};
const isScreenShare = isVideoBroadcasting();
const { presentationWidth, presentationHeight } = LayoutManager.calculatesPresentationSize(
mediaAreaWidth, mediaAreaHeight, presentationSlideWidth, presentationSlideHeight,
);
@ -538,16 +501,6 @@ class LayoutManager extends Component {
};
let newPresentationAreaSize;
let newScreenShareAreaSize;
if (isScreenShare) {
const { screenShareAreaWidth, screenShareAreaHeight } = this.calculatesPresentationAreaSize(
mediaAreaWidth, mediaAreaHeight, webcamsAreaWidth, webcamsAreaHeight,
);
newScreenShareAreaSize = {
width: screenShareAreaWidth,
height: screenShareAreaHeight,
};
} else {
const { presentationAreaWidth, presentationAreaHeight } = this.calculatesPresentationAreaSize(
mediaAreaWidth, mediaAreaHeight, webcamsAreaWidth, webcamsAreaHeight,
);
@ -562,7 +515,6 @@ class LayoutManager extends Component {
height: windowHeight(),
};
}
}
return {
mediaBounds: newMediaBounds,

View File

@ -21,6 +21,8 @@ const propTypes = {
webcamDraggableState: PropTypes.objectOf(Object).isRequired,
webcamDraggableDispatch: PropTypes.func.isRequired,
refMediaContainer: PropTypes.shape({ current: PropTypes.instanceOf(Element) }),
layoutContextState: PropTypes.objectOf(Object).isRequired,
layoutContextDispatch: PropTypes.func.isRequired,
};
const defaultProps = {