fix(SharedVideo): Ensure shared video takes filmstrip into account

This commit is contained in:
Mihai-Andrei Uscat 2021-05-25 12:55:57 +03:00 committed by GitHub
parent 574994607c
commit 01a127b557
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 18 additions and 3 deletions

View File

@ -25,6 +25,11 @@ type Props = {
*/
clientWidth: number,
/**
* Whether the (vertical) filmstrip is visible or not.
*/
filmstripVisible: boolean,
/**
* Is the video shared by the local user.
*
@ -59,16 +64,24 @@ class SharedVideo extends Component<Props> {
* }}
*/
getDimensions() {
const { clientHeight, clientWidth } = this.props;
const { clientHeight, clientWidth, filmstripVisible } = this.props;
let width;
let height;
if (interfaceConfig.VERTICAL_FILMSTRIP) {
if (filmstripVisible) {
width = `${clientWidth - Filmstrip.getVerticalFilmstripWidth()}px`;
} else {
width = `${clientWidth}px`;
}
height = `${clientHeight - getToolboxHeight()}px`;
width = `${clientWidth - Filmstrip.getVerticalFilmstripWidth()}px`;
} else {
height = `${clientHeight - Filmstrip.getFilmstripHeight()}px`;
if (filmstripVisible) {
height = `${clientHeight - Filmstrip.getFilmstripHeight()}px`;
} else {
height = `${clientHeight}px`;
}
width = `${clientWidth}px`;
}
@ -132,12 +145,14 @@ class SharedVideo extends Component<Props> {
function _mapStateToProps(state) {
const { ownerId, videoUrl } = state['features/shared-video'];
const { clientHeight, clientWidth } = state['features/base/responsive-ui'];
const { visible } = state['features/filmstrip'];
const localParticipant = getLocalParticipant(state);
return {
clientHeight,
clientWidth,
filmstripVisible: visible,
isOwner: ownerId === localParticipant.id,
sharedVideoId: videoUrl,
sharedYoutubeVideoId: getYoutubeId(videoUrl)