screenshare layout values

This commit is contained in:
Ramon Souza 2021-06-15 10:47:37 -03:00
parent d2e2a34dfe
commit e1f1b2e49f
6 changed files with 70 additions and 2 deletions

View File

@ -914,6 +914,34 @@ const reducer = (state, action) => {
},
};
}
case ACTIONS.SET_SCREEN_SHARE_OUTPUT: {
const {
width,
height,
top,
left,
} = action.value;
const { screenShare } = state.output;
if (screenShare.width === width
&& screenShare.height === height
&& screenShare.top === top
&& screenShare.left === left) {
return state;
}
return {
...state,
output: {
...state.output,
screenShare: {
...screenShare,
width,
height,
top,
left,
},
},
};
}
// EXTERNAL VIDEO
case ACTIONS.SET_HAS_EXTERNAL_VIDEO: {

View File

@ -794,6 +794,16 @@ class CustomLayout extends Component {
zIndex: presentationBounds.zIndex,
},
});
newLayoutContextDispatch({
type: ACTIONS.SET_SCREEN_SHARE_OUTPUT,
value: {
width: presentationBounds.width,
height: presentationBounds.height,
top: presentationBounds.top,
left: presentationBounds.left,
},
});
}
render() {

View File

@ -571,6 +571,16 @@ class PresentationFocusLayout extends Component {
zIndex: presentationBounds.zIndex,
},
});
newLayoutContextDispatch({
type: ACTIONS.SET_SCREEN_SHARE_OUTPUT,
value: {
width: presentationBounds.width,
height: presentationBounds.height,
top: presentationBounds.top,
left: presentationBounds.left,
},
});
}
render() {

View File

@ -598,6 +598,16 @@ class SmartLayout extends Component {
zIndex: presentationBounds.zIndex,
},
});
newLayoutContextDispatch({
type: ACTIONS.SET_SCREEN_SHARE_OUTPUT,
value: {
width: presentationBounds.width,
height: presentationBounds.height,
top: presentationBounds.top,
left: presentationBounds.left,
},
});
}
render() {

View File

@ -590,6 +590,16 @@ class VideoFocusLayout extends Component {
left: false,
},
});
newLayoutContextDispatch({
type: ACTIONS.SET_SCREEN_SHARE_OUTPUT,
value: {
width: presentationBounds.width,
height: presentationBounds.height,
top: presentationBounds.top,
left: presentationBounds.left,
},
});
}
render() {

View File

@ -14,10 +14,10 @@ const ScreenshareContainer = (props) => {
const NewLayoutManager = useContext(NLayoutContext);
const { newLayoutContextState } = NewLayoutManager;
const { output, layoutLoaded } = newLayoutContextState;
const { presentation } = output;
const { screenShare } = output;
if (isVideoBroadcasting()) {
return <ScreenshareComponent {...props} {...presentation} layoutLoaded={layoutLoaded}/>;
return <ScreenshareComponent {...props} {...screenShare} layoutLoaded={layoutLoaded} />;
}
return null;
};