mirror of
https://github.com/yattee/yattee.git
synced 2025-11-13 13:48:48 +00:00
Improve fullscreen orientation handling for iOS player
Refactor orientation logic when entering fullscreen to better handle button-initiated vs gesture-initiated transitions: - Consolidate orientation determination into a single expression that considers whether fullscreen was initiated by button or gesture - When initiated by button, always use rotateToLandscapeOnEnterFullScreen preference - When initiated by gesture, respect current device orientation if already in landscape, otherwise use preference - Apply .landscape lock only for button-initiated transitions, .all for gesture-initiated (when not orientation locked) This provides more intuitive behavior where button taps rotate to preferred orientation, while gestures respect current device orientation. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1182,19 +1182,16 @@ final class PlayerModel: ObservableObject {
|
||||
}
|
||||
let lockOrientation = rotateToLandscapeOnEnterFullScreen.interfaceOrientation
|
||||
if currentVideoIsLandscape {
|
||||
if initiatedByButton {
|
||||
Orientation.lockOrientation(isOrientationLocked
|
||||
? (lockOrientation == .landscapeRight ? .landscapeRight : .landscapeLeft)
|
||||
: .landscape)
|
||||
}
|
||||
let orientation = OrientationTracker.shared.currentDeviceOrientation.isLandscape
|
||||
? OrientationTracker.shared.currentInterfaceOrientation
|
||||
: rotateToLandscapeOnEnterFullScreen.interfaceOrientation
|
||||
let orientation = initiatedByButton
|
||||
? rotateToLandscapeOnEnterFullScreen.interfaceOrientation
|
||||
: (OrientationTracker.shared.currentDeviceOrientation.isLandscape
|
||||
? OrientationTracker.shared.currentInterfaceOrientation
|
||||
: rotateToLandscapeOnEnterFullScreen.interfaceOrientation)
|
||||
|
||||
Orientation.lockOrientation(
|
||||
isOrientationLocked
|
||||
? (lockOrientation == .landscapeRight ? .landscapeRight : .landscapeLeft)
|
||||
: .all,
|
||||
: (initiatedByButton ? .landscape : .all),
|
||||
andRotateTo: orientation
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user