Factor the height of the header into the max video height

pull/21833/head
David Baker 2020-11-19 17:33:43 +00:00
parent c411213db1
commit b518b33169
1 changed files with 4 additions and 1 deletions

View File

@ -86,6 +86,9 @@ function exitFullscreen() {
} }
const CONTROLS_HIDE_DELAY = 1000; const CONTROLS_HIDE_DELAY = 1000;
// Height of the header duplicated from CSS because we need to subtract it from our max
// height to get the max height of the video
const HEADER_HEIGHT = 44;
export default class CallView extends React.Component<IProps, IState> { export default class CallView extends React.Component<IProps, IState> {
private dispatcherRef: string; private dispatcherRef: string;
@ -361,7 +364,7 @@ export default class CallView extends React.Component<IProps, IState> {
if (this.state.call.type === CallType.Video) { if (this.state.call.type === CallType.Video) {
// if we're fullscreen, we don't want to set a maxHeight on the video element. // if we're fullscreen, we don't want to set a maxHeight on the video element.
const maxVideoHeight = getFullScreenElement() ? null : this.props.maxVideoHeight; const maxVideoHeight = getFullScreenElement() ? null : this.props.maxVideoHeight - HEADER_HEIGHT;
contentView = <div className="mx_CallView_video" ref={this.contentRef} onMouseMove={this.onMouseMove}> contentView = <div className="mx_CallView_video" ref={this.contentRef} onMouseMove={this.onMouseMove}>
<VideoFeed type={VideoFeedType.Remote} call={this.state.call} onResize={this.props.onResize} <VideoFeed type={VideoFeedType.Remote} call={this.state.call} onResize={this.props.onResize}
maxHeight={maxVideoHeight} maxHeight={maxVideoHeight}