From 61a50a857845d45807f1ed9f12bebefe07c963e9 Mon Sep 17 00:00:00 2001 From: liatvi Date: Sun, 21 Apr 2024 13:47:17 +0300 Subject: [PATCH] Revert "hack for video item" (#1210) This reverts commit 21e2805ea187bf15eb2c618fc77112979613e4b0. --- packages/gallery/src/components/item/videos/videoItem.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/gallery/src/components/item/videos/videoItem.js b/packages/gallery/src/components/item/videos/videoItem.js index 31cf78cd1..32837eef6 100644 --- a/packages/gallery/src/components/item/videos/videoItem.js +++ b/packages/gallery/src/components/item/videos/videoItem.js @@ -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(); }); @@ -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