Added basic player methods

This commit is contained in:
Rasmus Krämer
2022-04-14 14:39:09 +02:00
parent 6c65c8a33e
commit 7a9f6ff2ca
7 changed files with 198 additions and 2 deletions
+3
View File
@@ -78,6 +78,8 @@ class AudioPlayer: NSObject {
// DispatchQueue.main.sync {
UIApplication.shared.endReceivingRemoteControlEvents()
// }
NotificationCenter.default.post(name: NSNotification.Name(PlayerEvents.closed.rawValue), object: nil)
}
// MARK: - Methods
@@ -239,6 +241,7 @@ class AudioPlayer: NSObject {
}
}
private func updateNowPlaying() {
NotificationCenter.default.post(name: NSNotification.Name(PlayerEvents.update.rawValue), object: nil)
NowPlayingInfo.update(duration: getDuration(), currentTime: getCurrentTime(), rate: rate)
}