Merge pull request #743 from stonerl/controllcenter-swipe

Stay fullscreen when opening notification center
This commit is contained in:
Arkadiusz Fal 2024-08-24 12:09:28 +02:00 committed by GitHub
commit 2b41c73d56
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -32,8 +32,12 @@ extension VideoPlayerView {
let horizontalDrag = value.translation.width
#if os(iOS)
if viewDragOffset > 0, !isVerticalDrag {
isVerticalDrag = true
// Detect if the gesture starts within the top 5% of the screen and the player is in fullscreen mode
if value.startLocation.y <= UIScreen.main.bounds.height * 0.05, PlayerModel.shared.playingFullScreen {
// If it's a downward swipe, do nothing (return early)
if verticalDrag > 0, abs(verticalDrag) > abs(horizontalDrag) {
return
}
}
#endif