1
0
mirror of https://github.com/yattee/yattee.git synced 2024-12-15 06:40:32 +05:30

Clear system controls after closing item

This commit is contained in:
Arkadiusz Fal 2022-08-15 00:13:29 +02:00
parent d21d149624
commit 4ec9791467

View File

@ -559,6 +559,7 @@ final class PlayerModel: ObservableObject {
prepareCurrentItemForHistory(finished: finished)
currentItem = nil
updateNowPlayingInfo()
backend.closeItem()
aspectRatio = VideoPlayerView.defaultAspectRatio
@ -749,7 +750,7 @@ final class PlayerModel: ObservableObject {
#if os(macOS)
var windowTitle: String {
currentVideo.isNil ? "Not playing" : "\(currentVideo!.title) - \(currentVideo!.author)"
currentVideo.isNil ? "Not Playing" : "\(currentVideo!.title) - \(currentVideo!.author)"
}
#else
func handleEnterForeground() {
@ -788,6 +789,7 @@ final class PlayerModel: ObservableObject {
func updateNowPlayingInfo() {
guard let video = currentItem?.video else {
MPNowPlayingInfoCenter.default().nowPlayingInfo = .none
return
}