mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2026-07-30 08:28:34 +02:00
Mark session as inactive if end of queue is reached.
Ensures UI shows paused and stops incrementing session time.
This commit is contained in:
@@ -768,6 +768,11 @@ class AudioPlayer: NSObject {
|
||||
if keyPath == #keyPath(AVPlayer.currentItem) {
|
||||
NotificationCenter.default.post(name: NSNotification.Name(PlayerEvents.update.rawValue), object: nil)
|
||||
logger.log("WARNING: Item ended")
|
||||
|
||||
if audioPlayer.currentItem == nil {
|
||||
logger.log("Player ended or next item is nil, marking ended")
|
||||
self.markAudioSessionAs(active: false)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
super.observeValue(forKeyPath: keyPath, of: object, change: change, context: context)
|
||||
|
||||
Reference in New Issue
Block a user