Fix webcams bug in screenshare
This commit is contained in:
parent
cd289a47c3
commit
9a08349b36
@ -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,30 +501,19 @@ class LayoutManager extends Component {
|
||||
};
|
||||
let newPresentationAreaSize;
|
||||
let newScreenShareAreaSize;
|
||||
|
||||
if (isScreenShare) {
|
||||
const { screenShareAreaWidth, screenShareAreaHeight } = this.calculatesPresentationAreaSize(
|
||||
mediaAreaWidth, mediaAreaHeight, webcamsAreaWidth, webcamsAreaHeight,
|
||||
);
|
||||
newScreenShareAreaSize = {
|
||||
width: screenShareAreaWidth,
|
||||
height: screenShareAreaHeight,
|
||||
const { presentationAreaWidth, presentationAreaHeight } = this.calculatesPresentationAreaSize(
|
||||
mediaAreaWidth, mediaAreaHeight, webcamsAreaWidth, webcamsAreaHeight,
|
||||
);
|
||||
if (!presentationIsFullscreen) {
|
||||
newPresentationAreaSize = {
|
||||
width: presentationAreaWidth || 0,
|
||||
height: presentationAreaHeight || 0,
|
||||
};
|
||||
} else {
|
||||
const { presentationAreaWidth, presentationAreaHeight } = this.calculatesPresentationAreaSize(
|
||||
mediaAreaWidth, mediaAreaHeight, webcamsAreaWidth, webcamsAreaHeight,
|
||||
);
|
||||
if (!presentationIsFullscreen) {
|
||||
newPresentationAreaSize = {
|
||||
width: presentationAreaWidth || 0,
|
||||
height: presentationAreaHeight || 0,
|
||||
};
|
||||
} else {
|
||||
newPresentationAreaSize = {
|
||||
width: windowWidth(),
|
||||
height: windowHeight(),
|
||||
};
|
||||
}
|
||||
newPresentationAreaSize = {
|
||||
width: windowWidth(),
|
||||
height: windowHeight(),
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
|
@ -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 = {
|
||||
|
Loading…
Reference in New Issue
Block a user