From 4ec97914673fcd4736b0da6e7e15f2769bc0f2b7 Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Mon, 15 Aug 2022 00:13:29 +0200 Subject: [PATCH] Clear system controls after closing item --- Model/Player/PlayerModel.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Model/Player/PlayerModel.swift b/Model/Player/PlayerModel.swift index 5e282f95..ceef946e 100644 --- a/Model/Player/PlayerModel.swift +++ b/Model/Player/PlayerModel.swift @@ -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 }