fix(tileview) Enlarge tiles to fill whole space (#10201)
This commit is contained in:
parent
9e3084ef48
commit
1793bf460e
|
@ -509,13 +509,26 @@ class Thumbnail extends Component<Props, State> {
|
||||||
* @returns {Object} - The styles for the thumbnail.
|
* @returns {Object} - The styles for the thumbnail.
|
||||||
*/
|
*/
|
||||||
_getStyles(): Object {
|
_getStyles(): Object {
|
||||||
const { _height, _isHidden, _width, style, horizontalOffset } = this.props;
|
|
||||||
|
const { canPlayEventReceived } = this.state;
|
||||||
|
const {
|
||||||
|
_height,
|
||||||
|
_isHidden,
|
||||||
|
_isScreenSharing,
|
||||||
|
_participant,
|
||||||
|
_width,
|
||||||
|
horizontalOffset,
|
||||||
|
style
|
||||||
|
} = this.props;
|
||||||
|
|
||||||
let styles: {
|
let styles: {
|
||||||
|
avatar: Object,
|
||||||
thumbnail: Object,
|
thumbnail: Object,
|
||||||
avatar: Object
|
video: Object
|
||||||
} = {
|
} = {
|
||||||
thumbnail: {},
|
thumbnail: {},
|
||||||
avatar: {}
|
avatar: {},
|
||||||
|
video: {}
|
||||||
};
|
};
|
||||||
|
|
||||||
const avatarSize = _height / 2;
|
const avatarSize = _height / 2;
|
||||||
|
@ -525,6 +538,20 @@ class Thumbnail extends Component<Props, State> {
|
||||||
left += horizontalOffset;
|
left += horizontalOffset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let videoStyles = null;
|
||||||
|
|
||||||
|
if (!_isScreenSharing) {
|
||||||
|
if (canPlayEventReceived || _participant.local) {
|
||||||
|
videoStyles = {
|
||||||
|
objectFit: _height > 320 ? 'cover' : 'contain'
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
videoStyles = {
|
||||||
|
display: 'none'
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
styles = {
|
styles = {
|
||||||
thumbnail: {
|
thumbnail: {
|
||||||
...style,
|
...style,
|
||||||
|
@ -537,7 +564,8 @@ class Thumbnail extends Component<Props, State> {
|
||||||
avatar: {
|
avatar: {
|
||||||
height: `${avatarSize}px`,
|
height: `${avatarSize}px`,
|
||||||
width: `${avatarSize}px`
|
width: `${avatarSize}px`
|
||||||
}
|
},
|
||||||
|
video: videoStyles
|
||||||
};
|
};
|
||||||
|
|
||||||
if (_isHidden) {
|
if (_isHidden) {
|
||||||
|
@ -836,6 +864,7 @@ class Thumbnail extends Component<Props, State> {
|
||||||
<VideoTrack
|
<VideoTrack
|
||||||
className = { videoTrackClassName }
|
className = { videoTrackClassName }
|
||||||
id = 'localVideo_container'
|
id = 'localVideo_container'
|
||||||
|
style = { styles.video }
|
||||||
videoTrack = { _videoTrack } />
|
videoTrack = { _videoTrack } />
|
||||||
</span>
|
</span>
|
||||||
<div className = 'videocontainer__toolbar'>
|
<div className = 'videocontainer__toolbar'>
|
||||||
|
@ -934,7 +963,7 @@ class Thumbnail extends Component<Props, State> {
|
||||||
_volume = 1
|
_volume = 1
|
||||||
} = this.props;
|
} = this.props;
|
||||||
const { id } = _participant;
|
const { id } = _participant;
|
||||||
const { audioLevel, canPlayEventReceived } = this.state;
|
const { audioLevel } = this.state;
|
||||||
const styles = this._getStyles();
|
const styles = this._getStyles();
|
||||||
const containerClassName = this._getContainerClassName();
|
const containerClassName = this._getContainerClassName();
|
||||||
|
|
||||||
|
@ -952,10 +981,6 @@ class Thumbnail extends Component<Props, State> {
|
||||||
|
|
||||||
videoEventListeners.onCanPlay = this._onCanPlay;
|
videoEventListeners.onCanPlay = this._onCanPlay;
|
||||||
|
|
||||||
const videoElementStyle = canPlayEventReceived ? null : {
|
|
||||||
display: 'none'
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<span
|
<span
|
||||||
className = { containerClassName }
|
className = { containerClassName }
|
||||||
|
@ -978,7 +1003,7 @@ class Thumbnail extends Component<Props, State> {
|
||||||
eventHandlers = { videoEventListeners }
|
eventHandlers = { videoEventListeners }
|
||||||
id = { `remoteVideo_${videoTrackId || ''}` }
|
id = { `remoteVideo_${videoTrackId || ''}` }
|
||||||
muted = { true }
|
muted = { true }
|
||||||
style = { videoElementStyle }
|
style = { styles.video }
|
||||||
videoTrack = { _videoTrack } />
|
videoTrack = { _videoTrack } />
|
||||||
}
|
}
|
||||||
<div className = 'videocontainer__background' />
|
<div className = 'videocontainer__background' />
|
||||||
|
|
|
@ -215,8 +215,8 @@ export function calculateThumbnailSizeForTileView({
|
||||||
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
height,
|
height: initialHeight,
|
||||||
width
|
width: initialWidth
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue