Skip to content

Commit

Permalink
Revert "hack for video item" (#1210)
Browse files Browse the repository at this point in the history
This reverts commit 21e2805.
  • Loading branch information
liatv committed Apr 21, 2024
1 parent 08dad94 commit 61a50a8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/gallery/src/components/item/videos/videoItem.js
Expand Up @@ -27,11 +27,11 @@ class VideoItem extends React.Component {
}

dynamiclyImportVideoPlayers() {
if (!(window && window?.[window.location.href]?.ReactPlayer)) {
if (!(window && window.ReactPlayer)) {
import(
/* webpackChunkName: "proGallery_reactPlayer" */ 'react-player'
).then((ReactPlayer) => {
window[window.location.href] = { ReactPlayer: ReactPlayer.default };
window.ReactPlayer = ReactPlayer.default;
this.setState({ reactPlayerLoaded: true });
this.playVideoIfNeeded();
});
Expand Down Expand Up @@ -144,13 +144,13 @@ class VideoItem extends React.Component {
if (
!(
window &&
window?.[window.location.href]?.ReactPlayer &&
window.ReactPlayer &&
(this.state.loadVideo || this.props.playing)
)
) {
return null;
}
const PlayerElement = window?.[window.location.href]?.ReactPlayer;
const PlayerElement = window.ReactPlayer;
const isWiderThenContainer = this.props.style.ratio >= this.props.cropRatio;

// adding 1 pixel to compensate for the difference we have sometimes from layouter in grid fill
Expand Down

0 comments on commit 61a50a8

Please sign in to comment.