From 48b35988aef3ec5c3ce9f8dd5fb67971f2437647 Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Sat, 13 Aug 2022 16:18:27 +0200 Subject: [PATCH] Close overlays on exiting full screen --- Shared/Player/VideoPlayerView.swift | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Shared/Player/VideoPlayerView.swift b/Shared/Player/VideoPlayerView.swift index d0cada1b..0ef29e33 100644 --- a/Shared/Player/VideoPlayerView.swift +++ b/Shared/Player/VideoPlayerView.swift @@ -276,16 +276,23 @@ struct VideoPlayerView: View { #endif } } + .onChange(of: fullScreenLayout) { newValue in + if !newValue { playerControls.presentingDetailsOverlay = false } + } #if os(iOS) .statusBar(hidden: fullScreenLayout) #endif } var fullScreenLayout: Bool { + if player.currentItem.isNil { + return false + } + #if os(iOS) - player.playingFullScreen || verticalSizeClass == .compact + return player.playingFullScreen || verticalSizeClass == .compact #else - player.playingFullScreen + return player.playingFullScreen #endif }