Fix PictureInPicture to work in quotes

This commit is contained in:
noellabo 2020-10-07 22:28:02 +09:00
parent 9be377319f
commit e9ee34d3f4

View file

@ -381,10 +381,10 @@ class Status extends ImmutablePureComponent {
status = status.get('reblog');
}
if (status.get('media_attachments').size > 0) {
if (pictureInPicture.get('inUse')) {
media = <PictureInPicturePlaceholder width={this.props.cachedMediaWidth} />;
} else if (status.get('media_attachments').size > 0) {
if (this.props.muted) {
} else if (this.props.muted) {
media = (
<AttachmentList
compact
@ -492,7 +492,9 @@ class Status extends ImmutablePureComponent {
let quote_media = null;
if (quote_status.get('media_attachments').size > 0) {
if (this.props.muted) {
if (pictureInPicture.get('inUse')) {
quote_media = <PictureInPicturePlaceholder width={this.props.cachedMediaWidth} />;
} else if (this.props.muted) {
quote_media = (
<AttachmentList
compact
@ -516,6 +518,7 @@ class Status extends ImmutablePureComponent {
width={this.props.cachedMediaWidth}
height={70}
cacheWidth={this.props.cacheMediaWidth}
deployPictureInPicture={pictureInPicture.get('available') ? this.handleDeployPictureInPicture : undefined}
/>
)}
</Bundle>
@ -537,6 +540,7 @@ class Status extends ImmutablePureComponent {
sensitive={quote_status.get('sensitive')}
onOpenVideo={this.handleOpenVideo}
cacheWidth={this.props.cacheMediaWidth}
deployPictureInPicture={pictureInPicture.get('available') ? this.handleDeployPictureInPicture : undefined}
visible={this.state.showQuoteMedia}
onToggleVisibility={this.handleToggleQuoteMediaVisibility}
quote