diff --git a/materialious/src/lib/components/Player.svelte b/materialious/src/lib/components/Player.svelte index a89c2f6f..61ff7720 100644 --- a/materialious/src/lib/components/Player.svelte +++ b/materialious/src/lib/components/Player.svelte @@ -434,6 +434,8 @@ if (document.fullscreenElement) { document.exitFullscreen(); playerIsFullscreen = false; + + setTimeout(() => updateVideoPlayerHeight(), 100); } else { playerContainer.requestFullscreen(); playerIsFullscreen = true; @@ -579,10 +581,12 @@ // we calaculate player height to then allow children pages // to wrap around it. function updateVideoPlayerHeight() { - if (playerContainer) { - const height = playerContainer.getBoundingClientRect().height; - document.documentElement.style.setProperty('--video-player-height', `${height + 10}px`); + if (!playerContainer) { + return; } + + const height = playerContainer.getBoundingClientRect().height; + document.documentElement.style.setProperty('--video-player-height', `${height + 10}px`); } let showPlayerUiTimeout: ReturnType;