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)
|
model.prepareCurrentItemForHistory(finished: true)
|
||||||
|
|
||||||
if model.queue.isEmpty {
|
if model.queue.isEmpty {
|
||||||
|
if Defaults[.closeVideoOnEOF] {
|
||||||
#if os(tvOS)
|
#if os(tvOS)
|
||||||
if model.activeBackend == .appleAVPlayer {
|
if model.activeBackend == .appleAVPlayer {
|
||||||
model.avPlayerBackend.controller?.dismiss(animated: false)
|
model.avPlayerBackend.controller?.dismiss(animated: false)
|
||||||
@ -117,6 +118,7 @@ extension PlayerBackend {
|
|||||||
#endif
|
#endif
|
||||||
model.resetQueue()
|
model.resetQueue()
|
||||||
model.hide()
|
model.hide()
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
model.advanceToNextItem()
|
model.advanceToNextItem()
|
||||||
}
|
}
|
||||||
|
@ -158,6 +158,7 @@ extension Defaults.Keys {
|
|||||||
#if !os(macOS)
|
#if !os(macOS)
|
||||||
static let pauseOnEnteringBackground = Key<Bool>("pauseOnEnteringBackground", default: true)
|
static let pauseOnEnteringBackground = Key<Bool>("pauseOnEnteringBackground", default: true)
|
||||||
#endif
|
#endif
|
||||||
|
static let closeVideoOnEOF = Key<Bool>("closeVideoOnEOF", default: false)
|
||||||
static let closePiPOnNavigation = Key<Bool>("closePiPOnNavigation", default: false)
|
static let closePiPOnNavigation = Key<Bool>("closePiPOnNavigation", default: false)
|
||||||
static let closePiPOnOpeningPlayer = Key<Bool>("closePiPOnOpeningPlayer", default: false)
|
static let closePiPOnOpeningPlayer = Key<Bool>("closePiPOnOpeningPlayer", default: false)
|
||||||
#if !os(macOS)
|
#if !os(macOS)
|
||||||
|
@ -13,6 +13,7 @@ struct PlayerSettings: View {
|
|||||||
#endif
|
#endif
|
||||||
@Default(.expandVideoDescription) private var expandVideoDescription
|
@Default(.expandVideoDescription) private var expandVideoDescription
|
||||||
@Default(.pauseOnHidingPlayer) private var pauseOnHidingPlayer
|
@Default(.pauseOnHidingPlayer) private var pauseOnHidingPlayer
|
||||||
|
@Default(.closeVideoOnEOF) private var closeVideoOnEOF
|
||||||
#if os(iOS)
|
#if os(iOS)
|
||||||
@Default(.honorSystemOrientationLock) private var honorSystemOrientationLock
|
@Default(.honorSystemOrientationLock) private var honorSystemOrientationLock
|
||||||
@Default(.enterFullscreenInLandscape) private var enterFullscreenInLandscape
|
@Default(.enterFullscreenInLandscape) private var enterFullscreenInLandscape
|
||||||
@ -66,6 +67,7 @@ struct PlayerSettings: View {
|
|||||||
sourcePicker
|
sourcePicker
|
||||||
}
|
}
|
||||||
pauseOnHidingPlayerToggle
|
pauseOnHidingPlayerToggle
|
||||||
|
closeVideoOnEOFToggle
|
||||||
#if !os(macOS)
|
#if !os(macOS)
|
||||||
pauseOnEnteringBackgroundToogle
|
pauseOnEnteringBackgroundToogle
|
||||||
#endif
|
#endif
|
||||||
@ -192,6 +194,10 @@ struct PlayerSettings: View {
|
|||||||
Toggle("Pause when player is closed", isOn: $pauseOnHidingPlayer)
|
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)
|
#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)
|
||||||
|
@ -245,7 +245,7 @@ struct SettingsView: View {
|
|||||||
case .browsing:
|
case .browsing:
|
||||||
return 880
|
return 880
|
||||||
case .player:
|
case .player:
|
||||||
return 450
|
return 480
|
||||||
case .controls:
|
case .controls:
|
||||||
return 920
|
return 920
|
||||||
case .quality:
|
case .quality:
|
||||||
|
Loading…
Reference in New Issue
Block a user