From 7b480411651216c0ac125a7d81a16cf69b3dd279 Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Thu, 1 Sep 2022 20:17:51 +0200 Subject: [PATCH] Fix opening player sheet --- Shared/Player/VideoPlayerView.swift | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Shared/Player/VideoPlayerView.swift b/Shared/Player/VideoPlayerView.swift index 3cc45376..5a6a2608 100644 --- a/Shared/Player/VideoPlayerView.swift +++ b/Shared/Player/VideoPlayerView.swift @@ -133,6 +133,13 @@ struct VideoPlayerView: View { #if os(iOS) .frame(width: playerWidth.isNil ? nil : Double(playerWidth!), height: playerHeight.isNil ? nil : Double(playerHeight!)) .ignoresSafeArea(.all, edges: playerEdgesIgnoringSafeArea) + .onChange(of: player.presentingPlayer) { newValue in + if newValue { + viewDragOffset = 0 + } else { + viewDragOffset = Self.hiddenOffset + } + } .onAppear { viewDragOffset = 0