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)
|
model.prepareCurrentItemForHistory(finished: true)
|
||||||
|
|
||||||
if model.queue.isEmpty {
|
if model.queue.isEmpty {
|
||||||
if Defaults[.closeVideoOnEOF] {
|
#if os(tvOS)
|
||||||
#if os(tvOS)
|
if Defaults[.closeVideoOnEOF] {
|
||||||
if model.activeBackend == .appleAVPlayer {
|
if model.activeBackend == .appleAVPlayer {
|
||||||
model.avPlayerBackend.controller?.dismiss(animated: false)
|
model.avPlayerBackend.controller?.dismiss(animated: false)
|
||||||
}
|
}
|
||||||
#endif
|
model.resetQueue()
|
||||||
model.resetQueue()
|
model.hide()
|
||||||
model.hide()
|
}
|
||||||
}
|
#else
|
||||||
|
if Defaults[.closeVideoOnEOF] {
|
||||||
|
model.resetQueue()
|
||||||
|
model.hide()
|
||||||
|
}
|
||||||
|
|
||||||
|
if !Defaults[.closeVideoOnEOF], Defaults[.exitFullscreenOnEOF], model.playingFullScreen {
|
||||||
|
model.exitFullScreen()
|
||||||
|
}
|
||||||
|
#endif
|
||||||
} else {
|
} else {
|
||||||
model.advanceToNextItem()
|
model.advanceToNextItem()
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,7 @@ struct PlayerSettings: View {
|
|||||||
#if !os(tvOS)
|
#if !os(tvOS)
|
||||||
@Default(.showScrollToTopInComments) private var showScrollToTopInComments
|
@Default(.showScrollToTopInComments) private var showScrollToTopInComments
|
||||||
@Default(.collapsedLinesDescription) private var collapsedLinesDescription
|
@Default(.collapsedLinesDescription) private var collapsedLinesDescription
|
||||||
|
@Default(.exitFullscreenOnEOF) private var exitFullscreenOnEOF
|
||||||
#endif
|
#endif
|
||||||
@Default(.expandVideoDescription) private var expandVideoDescription
|
@Default(.expandVideoDescription) private var expandVideoDescription
|
||||||
@Default(.pauseOnHidingPlayer) private var pauseOnHidingPlayer
|
@Default(.pauseOnHidingPlayer) private var pauseOnHidingPlayer
|
||||||
@ -85,6 +86,9 @@ struct PlayerSettings: View {
|
|||||||
}
|
}
|
||||||
pauseOnHidingPlayerToggle
|
pauseOnHidingPlayerToggle
|
||||||
closeVideoOnEOFToggle
|
closeVideoOnEOFToggle
|
||||||
|
#if !os(tvOS)
|
||||||
|
exitFullscreenOnEOFToggle
|
||||||
|
#endif
|
||||||
#if !os(macOS)
|
#if !os(macOS)
|
||||||
pauseOnEnteringBackgroundToogle
|
pauseOnEnteringBackgroundToogle
|
||||||
#endif
|
#endif
|
||||||
@ -294,6 +298,13 @@ struct PlayerSettings: View {
|
|||||||
Toggle("Close video and player on end", isOn: $closeVideoOnEOF)
|
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)
|
#if !os(macOS)
|
||||||
private var pauseOnEnteringBackgroundToogle: some View {
|
private var pauseOnEnteringBackgroundToogle: some View {
|
||||||
Toggle("Pause when entering background", isOn: $pauseOnEnteringBackground)
|
Toggle("Pause when entering background", isOn: $pauseOnEnteringBackground)
|
||||||
|
Loading…
Reference in New Issue
Block a user