Fix opening player sheet

This commit is contained in:
Arkadiusz Fal 2022-09-01 20:17:51 +02:00
parent df96c2dba0
commit 7b48041165

View File

@ -133,6 +133,13 @@ struct VideoPlayerView: View {
#if os(iOS) #if os(iOS)
.frame(width: playerWidth.isNil ? nil : Double(playerWidth!), height: playerHeight.isNil ? nil : Double(playerHeight!)) .frame(width: playerWidth.isNil ? nil : Double(playerWidth!), height: playerHeight.isNil ? nil : Double(playerHeight!))
.ignoresSafeArea(.all, edges: playerEdgesIgnoringSafeArea) .ignoresSafeArea(.all, edges: playerEdgesIgnoringSafeArea)
.onChange(of: player.presentingPlayer) { newValue in
if newValue {
viewDragOffset = 0
} else {
viewDragOffset = Self.hiddenOffset
}
}
.onAppear { .onAppear {
viewDragOffset = 0 viewDragOffset = 0