mirror of
https://github.com/yattee/yattee.git
synced 2026-08-05 23:01:28 +00:00
Fix double-tap fullscreen gesture rotating on portrait videos
The fullscreen button routes through a portrait-video check (toggling the details panel instead of rotating), but the double-tap gesture called onToggleFullscreen directly and always rotated to landscape. Extract the shared decision into PlayerControlsActions.performFullscreenTap() and use it from both the button and the tap gesture handler.
This commit is contained in:
@@ -125,7 +125,7 @@ struct ControlsSectionRenderer: View {
|
||||
case .fullscreen:
|
||||
if actions.shouldShowFullscreenButton {
|
||||
controlButton(systemImage: actions.fullscreenIcon) {
|
||||
handleFullscreenTap()
|
||||
actions.performFullscreenTap()
|
||||
}
|
||||
.disabled(isLocked)
|
||||
.opacity(isLocked ? 0.5 : 1.0)
|
||||
@@ -818,26 +818,6 @@ struct ControlsSectionRenderer: View {
|
||||
.animation(.easeInOut(duration: 0.2), value: isBrightnessExpanded)
|
||||
}
|
||||
|
||||
// MARK: - Fullscreen Handling
|
||||
|
||||
private func handleFullscreenTap() {
|
||||
let isActualWidescreenLayout = actions.isWideScreenLayout && actions.onTogglePanel != nil
|
||||
|
||||
if actions.isIPad {
|
||||
// iPad: always toggle details visibility
|
||||
actions.onToggleDetailsVisibility?()
|
||||
} else if isActualWidescreenLayout && actions.isFullscreen && !actions.isWidescreenVideo {
|
||||
// iPhone in landscape with portrait video fullscreen: rotate back to portrait
|
||||
actions.onToggleFullscreen?()
|
||||
} else if !actions.isWidescreenVideo {
|
||||
// iPhone portrait video in portrait layout: toggle details visibility
|
||||
actions.onToggleDetailsVisibility?()
|
||||
} else {
|
||||
// iPhone with widescreen video: rotate orientation
|
||||
actions.onToggleFullscreen?()
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Transport State
|
||||
|
||||
private var isTransportDisabled: Bool {
|
||||
|
||||
Reference in New Issue
Block a user