From 64fc5d76dfd7fdf6547b18bf55827dd690e356c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juraj=20Nyi=CC=81ri?= Date: Sun, 4 Jul 2021 14:29:46 +0200 Subject: [PATCH] Fix: Scroll position not locked when no trailer being played --- dist/plex-meets-homeassistant.js | 2 ++ src/modules/utils.ts | 1 + 2 files changed, 3 insertions(+) diff --git a/dist/plex-meets-homeassistant.js b/dist/plex-meets-homeassistant.js index 299843c..16412e7 100644 --- a/dist/plex-meets-homeassistant.js +++ b/dist/plex-meets-homeassistant.js @@ -19183,6 +19183,8 @@ const hasEpisodes = (media) => { const isVideoFullScreen = (_this) => { const videoPlayer = _this.getElementsByClassName('videoPlayer')[0]; const video = videoPlayer.children[0]; + if (!video) + return false; const body = document.getElementsByTagName('body')[0]; return ((video.offsetWidth === body.offsetWidth && video.offsetHeight === body.offsetHeight) || (_this.videoElem && _this.videoElem.classList.contains('simulatedFullScreen'))); diff --git a/src/modules/utils.ts b/src/modules/utils.ts index 598fe36..d467e48 100644 --- a/src/modules/utils.ts +++ b/src/modules/utils.ts @@ -79,6 +79,7 @@ const hasEpisodes = (media: Array>): boolean => { const isVideoFullScreen = (_this: any): boolean => { const videoPlayer = _this.getElementsByClassName('videoPlayer')[0] as HTMLElement; const video = videoPlayer.children[0] as any; + if (!video) return false; const body = document.getElementsByTagName('body')[0]; return ( (video.offsetWidth === body.offsetWidth && video.offsetHeight === body.offsetHeight) ||