[Glitch] Fix pop-out player appearing on mobile screens in web UI

Port 18ca4e0e9a to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
Eugen Rochko
2020-11-16 05:16:39 +01:00
committed by Claire
parent 30f4268f32
commit 870f0aae48
6 changed files with 110 additions and 86 deletions

View File

@ -99,8 +99,11 @@ class Status extends ImmutablePureComponent {
onClick: PropTypes.func,
scrollKey: PropTypes.string,
deployPictureInPicture: PropTypes.func,
usingPiP: PropTypes.bool,
settings: ImmutablePropTypes.map.isRequired,
pictureInPicture: PropTypes.shape({
inUse: PropTypes.bool,
available: PropTypes.bool,
}),
};
state = {
@ -126,7 +129,7 @@ class Status extends ImmutablePureComponent {
'hidden',
'expanded',
'unread',
'usingPiP',
'pictureInPicture',
]
updateOnStates = [
@ -503,7 +506,7 @@ class Status extends ImmutablePureComponent {
hidden,
unread,
featured,
usingPiP,
pictureInPicture,
...other
} = this.props;
const { isCollapsed, forceFilter } = this.state;
@ -595,7 +598,7 @@ class Status extends ImmutablePureComponent {
attachments = status.get('media_attachments');
if (usingPiP) {
if (pictureInPicture.inUse) {
media.push(<PictureInPicturePlaceholder width={this.props.cachedMediaWidth} />);
mediaIcons.push('video-camera');
} else if (attachments.size > 0) {
@ -623,7 +626,7 @@ class Status extends ImmutablePureComponent {
width={this.props.cachedMediaWidth}
height={110}
cacheWidth={this.props.cacheMediaWidth}
deployPictureInPicture={this.handleDeployPictureInPicture}
deployPictureInPicture={pictureInPicture.available ? this.handleDeployPictureInPicture : undefined}
sensitive={status.get('sensitive')}
blurhash={attachment.get('blurhash')}
visible={this.state.showMedia}
@ -652,7 +655,7 @@ class Status extends ImmutablePureComponent {
onOpenVideo={this.handleOpenVideo}
width={this.props.cachedMediaWidth}
cacheWidth={this.props.cacheMediaWidth}
deployPictureInPicture={this.handleDeployPictureInPicture}
deployPictureInPicture={pictureInPicture.available ? this.handleDeployPictureInPicture : undefined}
visible={this.state.showMedia}
onToggleVisibility={this.handleToggleMediaVisibility}
/>)}