Skip to content

Commit

Permalink
move to componentWillMount
Browse files Browse the repository at this point in the history
  • Loading branch information
noam-heller1 committed Jul 28, 2024
1 parent a8d69c3 commit ed72379
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/gallery/src/components/item/videos/videoItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,18 @@ class VideoItem extends React.Component {
vimeoPlayerLoaded: false,
hlsPlayerLoaded: false,
};
if (this.props.options.videoPlay === 'auto') {
this.dynamiclyImportVideoPlayers();
}
}

componentDidMount() {
this.dynamiclyImportVideoPlayers();
}

UNSAFE_componentWillMount() {
if (this.props.options.videoPlay === 'auto') {
this.dynamiclyImportVideoPlayers();
}
}

dynamiclyImportVideoPlayers() {
if (!(window && window.ReactPlayer)) {
import(
Expand Down

0 comments on commit ed72379

Please sign in to comment.