Skip to content

Commit

Permalink
[gallery] fix: video rendering placeholder (#1260)
Browse files Browse the repository at this point in the history
  • Loading branch information
IzaacAyelin authored Jul 9, 2024
1 parent f37164d commit fb10502
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class VideoItemWrapper extends React.Component {
}

async componentDidMount() {
if (!isEditMode() && this.mightPlayVideo()) {
if (!isEditMode()) {
try {
const VideoItem = await import(
/* webpackChunkName: "proGallery_videoItem" */ './videoItem'
Expand All @@ -104,15 +104,18 @@ class VideoItemWrapper extends React.Component {
}
}
}

render() {
const hover = this.props.hover;
const showVideoPlayButton =
!this.props.hidePlay && this.props.options.showVideoPlayButton;
const videoPlaceholder = this.createVideoPlaceholder(showVideoPlayButton);

const VideoItem = this.VideoItem;
if (!this.state.videoItemLoaded) {
const shouldRenderVideoItem =
!this.mightPlayVideo() ||
!this.state.videoItemLoaded ||
this.props.isPrerenderMode;
if (shouldRenderVideoItem) {
return (
<div>
{shouldCreateVideoPlaceholder(this.props.options) && videoPlaceholder}
Expand Down

0 comments on commit fb10502

Please sign in to comment.