mirror of
https://github.com/yattee/yattee.git
synced 2025-08-05 02:04:07 +00:00
Player controls settings
This commit is contained in:
@@ -32,6 +32,17 @@ struct PlayerControls: View {
|
||||
@Default(.buttonBackwardSeekDuration) private var buttonBackwardSeekDuration
|
||||
@Default(.buttonForwardSeekDuration) private var buttonForwardSeekDuration
|
||||
|
||||
#if os(iOS)
|
||||
@Default(.playerControlsLockOrientationEnabled) private var playerControlsLockOrientationEnabled
|
||||
#endif
|
||||
@Default(.playerControlsSettingsEnabled) private var playerControlsSettingsEnabled
|
||||
@Default(.playerControlsCloseEnabled) private var playerControlsCloseEnabled
|
||||
@Default(.playerControlsRestartEnabled) private var playerControlsRestartEnabled
|
||||
@Default(.playerControlsAdvanceToNextEnabled) private var playerControlsAdvanceToNextEnabled
|
||||
@Default(.playerControlsPlaybackModeEnabled) private var playerControlsPlaybackModeEnabled
|
||||
@Default(.playerControlsNextEnabled) private var playerControlsNextEnabled
|
||||
@Default(.playerControlsMusicModeEnabled) private var playerControlsMusicModeEnabled
|
||||
|
||||
private let controlsOverlayModel = ControlOverlaysModel.shared
|
||||
|
||||
var playerControlsLayout: PlayerControlsLayout {
|
||||
@@ -135,17 +146,30 @@ struct PlayerControls: View {
|
||||
seekBackwardButton
|
||||
seekForwardButton
|
||||
#endif
|
||||
restartVideoButton
|
||||
advanceToNextItemButton
|
||||
if playerControlsAdvanceToNextEnabled {
|
||||
restartVideoButton
|
||||
}
|
||||
if playerControlsAdvanceToNextEnabled {
|
||||
advanceToNextItemButton
|
||||
}
|
||||
Spacer()
|
||||
#if os(tvOS)
|
||||
settingsButton
|
||||
if playerControlsSettingsEnabled {
|
||||
settingsButton
|
||||
}
|
||||
#endif
|
||||
playbackModeButton
|
||||
if playerControlsPlaybackModeEnabled {
|
||||
playbackModeButton
|
||||
}
|
||||
if playerControlsNextEnabled {
|
||||
watchNextButton
|
||||
}
|
||||
#if os(tvOS)
|
||||
closeVideoButton
|
||||
#else
|
||||
musicModeButton
|
||||
if playerControlsMusicModeEnabled {
|
||||
musicModeButton
|
||||
}
|
||||
#endif
|
||||
}
|
||||
.zIndex(0)
|
||||
@@ -306,13 +330,20 @@ struct PlayerControls: View {
|
||||
|
||||
pipButton
|
||||
#if os(iOS)
|
||||
lockOrientationButton
|
||||
if playerControlsLockOrientationEnabled {
|
||||
lockOrientationButton
|
||||
}
|
||||
#endif
|
||||
|
||||
Spacer()
|
||||
|
||||
settingsButton
|
||||
closeVideoButton
|
||||
if playerControlsSettingsEnabled {
|
||||
settingsButton
|
||||
}
|
||||
|
||||
if playerControlsCloseEnabled {
|
||||
closeVideoButton
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -390,6 +421,12 @@ struct PlayerControls: View {
|
||||
}
|
||||
}
|
||||
|
||||
var watchNextButton: some View {
|
||||
button("Watch Next", systemImage: Constants.nextSystemImage) {
|
||||
WatchNextViewModel.shared.userInteractedOpen(player.currentItem)
|
||||
}
|
||||
}
|
||||
|
||||
var seekBackwardButton: some View {
|
||||
var foregroundColor: Color?
|
||||
var fontSize: Double?
|
||||
|
Reference in New Issue
Block a user