mirror of
https://github.com/yattee/yattee.git
synced 2024-12-22 21:43:41 +00:00
parent
c6798be167
commit
7d7bd40a89
@ -110,6 +110,7 @@ extension PlayerBackend {
|
||||
model.prepareCurrentItemForHistory(finished: true)
|
||||
|
||||
if model.queue.isEmpty {
|
||||
if Defaults[.closeVideoOnEOF] {
|
||||
#if os(tvOS)
|
||||
if model.activeBackend == .appleAVPlayer {
|
||||
model.avPlayerBackend.controller?.dismiss(animated: false)
|
||||
@ -117,6 +118,7 @@ extension PlayerBackend {
|
||||
#endif
|
||||
model.resetQueue()
|
||||
model.hide()
|
||||
}
|
||||
} else {
|
||||
model.advanceToNextItem()
|
||||
}
|
||||
|
@ -158,6 +158,7 @@ extension Defaults.Keys {
|
||||
#if !os(macOS)
|
||||
static let pauseOnEnteringBackground = Key<Bool>("pauseOnEnteringBackground", default: true)
|
||||
#endif
|
||||
static let closeVideoOnEOF = Key<Bool>("closeVideoOnEOF", default: false)
|
||||
static let closePiPOnNavigation = Key<Bool>("closePiPOnNavigation", default: false)
|
||||
static let closePiPOnOpeningPlayer = Key<Bool>("closePiPOnOpeningPlayer", default: false)
|
||||
#if !os(macOS)
|
||||
|
@ -13,6 +13,7 @@ struct PlayerSettings: View {
|
||||
#endif
|
||||
@Default(.expandVideoDescription) private var expandVideoDescription
|
||||
@Default(.pauseOnHidingPlayer) private var pauseOnHidingPlayer
|
||||
@Default(.closeVideoOnEOF) private var closeVideoOnEOF
|
||||
#if os(iOS)
|
||||
@Default(.honorSystemOrientationLock) private var honorSystemOrientationLock
|
||||
@Default(.enterFullscreenInLandscape) private var enterFullscreenInLandscape
|
||||
@ -66,6 +67,7 @@ struct PlayerSettings: View {
|
||||
sourcePicker
|
||||
}
|
||||
pauseOnHidingPlayerToggle
|
||||
closeVideoOnEOFToggle
|
||||
#if !os(macOS)
|
||||
pauseOnEnteringBackgroundToogle
|
||||
#endif
|
||||
@ -192,6 +194,10 @@ struct PlayerSettings: View {
|
||||
Toggle("Pause when player is closed", isOn: $pauseOnHidingPlayer)
|
||||
}
|
||||
|
||||
private var closeVideoOnEOFToggle: some View {
|
||||
Toggle("Close video and player on end", isOn: $closeVideoOnEOF)
|
||||
}
|
||||
|
||||
#if !os(macOS)
|
||||
private var pauseOnEnteringBackgroundToogle: some View {
|
||||
Toggle("Pause when entering background", isOn: $pauseOnEnteringBackground)
|
||||
|
@ -245,7 +245,7 @@ struct SettingsView: View {
|
||||
case .browsing:
|
||||
return 880
|
||||
case .player:
|
||||
return 450
|
||||
return 480
|
||||
case .controls:
|
||||
return 920
|
||||
case .quality:
|
||||
|
Loading…
Reference in New Issue
Block a user