mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2026-08-25 12:54:08 +02:00
iOS fix: Logging out when player is open crashing because server config is nil, added nil check in Api requests
This commit is contained in:
@@ -67,6 +67,8 @@ class AudioPlayer: NSObject {
|
||||
destroy()
|
||||
}
|
||||
public func destroy() {
|
||||
// Pause is not synchronous causing this error on below lines:
|
||||
// AVAudioSession_iOS.mm:1206 Deactivating an audio session that has running I/O. All I/O should be stopped or paused prior to deactivating the audio session
|
||||
pause()
|
||||
audioPlayer.replaceCurrentItem(with: nil)
|
||||
|
||||
@@ -77,9 +79,11 @@ class AudioPlayer: NSObject {
|
||||
print(error)
|
||||
}
|
||||
|
||||
// Throws error Possibly related to the error above
|
||||
// DispatchQueue.main.sync {
|
||||
UIApplication.shared.endReceivingRemoteControlEvents()
|
||||
// UIApplication.shared.endReceivingRemoteControlEvents()
|
||||
// }
|
||||
|
||||
NotificationCenter.default.post(name: NSNotification.Name(PlayerEvents.closed.rawValue), object: nil)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user