Hide orientation lock controls on iPad

The orientation lock feature is not applicable on iPad devices, so the lock orientation button and settings are now hidden when running on iPad.
This commit is contained in:
Arkadiusz Fal
2025-11-14 23:08:11 +01:00
parent fcb97a5591
commit 2ca08c8af5
3 changed files with 11 additions and 5 deletions

View File

@@ -333,7 +333,7 @@ struct PlayerControls: View {
pipButton
#if os(iOS)
if playerControlsLockOrientationEnabled {
if playerControlsLockOrientationEnabled, !Constants.isIPad {
lockOrientationButton
}
#endif

View File

@@ -71,7 +71,7 @@ struct VideoActions: View {
return actionButtonPipEnabled
#if os(iOS)
case .lockOrientation:
return actionButtonLockOrientationEnabled
return actionButtonLockOrientationEnabled && !Constants.isIPad
#endif
case .restart:
return actionButtonRestartEnabled
@@ -158,7 +158,9 @@ struct VideoActions: View {
actionButton("PiP", systemImage: player.pipImage, active: player.playingInPictureInPicture, action: player.togglePiPAction)
#if os(iOS)
case .lockOrientation:
actionButton("Lock", systemImage: player.lockOrientationImage, active: player.isOrientationLocked, action: player.lockOrientationAction)
if !Constants.isIPad {
actionButton("Lock", systemImage: player.lockOrientationImage, active: player.isOrientationLocked, action: player.lockOrientationAction)
}
#endif
case .restart:
actionButton("Replay", systemImage: "backward.end.fill", action: player.replayAction)

View File

@@ -366,7 +366,9 @@ struct PlayerControlsSettings: View {
}
Group {
#if os(iOS)
Toggle("Lock orientation", isOn: $actionButtonLockOrientationEnabled)
if !Constants.isIPad {
Toggle("Lock orientation", isOn: $actionButtonLockOrientationEnabled)
}
#endif
Toggle("Restart", isOn: $actionButtonRestartEnabled)
Toggle("Play next item", isOn: $actionButtonAdvanceToNextItemEnabled)
@@ -378,7 +380,9 @@ struct PlayerControlsSettings: View {
@ViewBuilder private var controlButtonToggles: some View {
#if os(iOS)
Toggle("Lock orientation", isOn: $playerControlsLockOrientationEnabled)
if !Constants.isIPad {
Toggle("Lock orientation", isOn: $playerControlsLockOrientationEnabled)
}
#endif
Toggle("Settings", isOn: $playerControlsSettingsEnabled)
#if !os(tvOS)