diff --git a/Model/Player/Backends/AVPlayerBackend.swift b/Model/Player/Backends/AVPlayerBackend.swift index 40c717e2..acad5b5a 100644 --- a/Model/Player/Backends/AVPlayerBackend.swift +++ b/Model/Player/Backends/AVPlayerBackend.swift @@ -480,13 +480,10 @@ final class AVPlayerBackend: PlayerBackend { return } - if self.controlsUpdates { - self.playerTime.duration = self.playerItemDuration ?? .zero - self.playerTime.currentTime = self.currentTime ?? .zero - } + self.model.updateNowPlayingInfo() - #if !os(tvOS) - self.model.updateNowPlayingInfo() + #if os(macOS) + MPNowPlayingInfoCenter.default().playbackState = self.avPlayer.timeControlStatus == .playing ? .playing : .paused #endif if let currentTime = self.currentTime { diff --git a/Model/Player/Backends/MPVBackend.swift b/Model/Player/Backends/MPVBackend.swift index a2dc6fc7..45d2d25c 100644 --- a/Model/Player/Backends/MPVBackend.swift +++ b/Model/Player/Backends/MPVBackend.swift @@ -3,6 +3,7 @@ import CoreMedia import Defaults import Foundation import Logging +import MediaPlayer import Repeat import SwiftUI @@ -59,6 +60,8 @@ final class MPVBackend: PlayerBackend { } else { ScreenSaverManager.shared.enable() } + + MPNowPlayingInfoCenter.default().playbackState = isPlaying ? .playing : .paused #else DispatchQueue.main.async { UIApplication.shared.isIdleTimerDisabled = self.model.presentingPlayer && self.isPlaying