make audio ducking and interruption more robust

Signed-off-by: Toni Förster <toni.foerster@gmail.com>

fix audio ducking and bluetooth play/pause

Signed-off-by: Toni Förster <toni.foerster@gmail.com>
This commit is contained in:
Toni Förster
2024-08-31 22:42:17 +02:00
parent 2d7a101ce0
commit e8fcee23ef
3 changed files with 54 additions and 38 deletions

View File

@@ -364,7 +364,11 @@ final class AVPlayerBackend: PlayerBackend {
let startPlaying = {
#if !os(macOS)
try? AVAudioSession.sharedInstance().setActive(true)
do {
try AVAudioSession.sharedInstance().setActive(true)
} catch {
self.logger.error("Error setting up audio session: \(error)")
}
#endif
self.setRate(self.model.currentRate)