mirror of
https://github.com/yattee/yattee.git
synced 2024-12-22 13:33:42 +00:00
add option to exit fullscreen on end
This commit is contained in:
parent
af75afa912
commit
64a18678ce
@ -111,15 +111,24 @@ extension PlayerBackend {
|
||||
model.prepareCurrentItemForHistory(finished: true)
|
||||
|
||||
if model.queue.isEmpty {
|
||||
if Defaults[.closeVideoOnEOF] {
|
||||
#if os(tvOS)
|
||||
if Defaults[.closeVideoOnEOF] {
|
||||
if model.activeBackend == .appleAVPlayer {
|
||||
model.avPlayerBackend.controller?.dismiss(animated: false)
|
||||
}
|
||||
#endif
|
||||
model.resetQueue()
|
||||
model.hide()
|
||||
}
|
||||
#else
|
||||
if Defaults[.closeVideoOnEOF] {
|
||||
model.resetQueue()
|
||||
model.hide()
|
||||
}
|
||||
|
||||
if !Defaults[.closeVideoOnEOF], Defaults[.exitFullscreenOnEOF], model.playingFullScreen {
|
||||
model.exitFullScreen()
|
||||
}
|
||||
#endif
|
||||
} else {
|
||||
model.advanceToNextItem()
|
||||
}
|
||||
|
@ -11,6 +11,7 @@ struct PlayerSettings: View {
|
||||
#if !os(tvOS)
|
||||
@Default(.showScrollToTopInComments) private var showScrollToTopInComments
|
||||
@Default(.collapsedLinesDescription) private var collapsedLinesDescription
|
||||
@Default(.exitFullscreenOnEOF) private var exitFullscreenOnEOF
|
||||
#endif
|
||||
@Default(.expandVideoDescription) private var expandVideoDescription
|
||||
@Default(.pauseOnHidingPlayer) private var pauseOnHidingPlayer
|
||||
@ -85,6 +86,9 @@ struct PlayerSettings: View {
|
||||
}
|
||||
pauseOnHidingPlayerToggle
|
||||
closeVideoOnEOFToggle
|
||||
#if !os(tvOS)
|
||||
exitFullscreenOnEOFToggle
|
||||
#endif
|
||||
#if !os(macOS)
|
||||
pauseOnEnteringBackgroundToogle
|
||||
#endif
|
||||
@ -294,6 +298,13 @@ struct PlayerSettings: View {
|
||||
Toggle("Close video and player on end", isOn: $closeVideoOnEOF)
|
||||
}
|
||||
|
||||
#if !os(tvOS)
|
||||
private var exitFullscreenOnEOFToggle: some View {
|
||||
Toggle("Exit fullscreen on end", isOn: $exitFullscreenOnEOF)
|
||||
.disabled(closeVideoOnEOF)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !os(macOS)
|
||||
private var pauseOnEnteringBackgroundToogle: some View {
|
||||
Toggle("Pause when entering background", isOn: $pauseOnEnteringBackground)
|
||||
|
Loading…
Reference in New Issue
Block a user