[PR #361] [MERGED] Fix: Handle iOS audio events #1416

Closed
opened 2026-04-24 23:58:17 +02:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/advplyr/audiobookshelf-app/pull/361
Author: @ronaldheft
Created: 9/3/2022
Status: Merged
Merged: 9/3/2022
Merged by: @advplyr

Base: masterHead: ios-audio-events


📝 Commits (5)

  • 20d9328 fix: Only mark audio session as active when playing
  • 11f2288 feat: Handle resuming iOS audio after pause
  • 82159ee feat: Handle route change notifications
  • d1c1902 Merge branch 'bug-ios-sleep-timer' into ios-audio-events
  • c119778 Merge branch 'advplyr:master' into ios-audio-events

📊 Changes

1 file changed (+73 additions, -1 deletions)

View changed files

📝 ios/App/Shared/player/AudioPlayer.swift (+73 -1)

📄 Description

This PR addresses several issues (fixes #343):

  • The active audio session is now changed to false when the player is paused
    • This also ensures the below fixes do not trigger when the player is paused
  • When an audio interruption occurs (such as Siri, directions in CarPlay, a phone call, etc), if ABS was playing before the interruption occurred, ABS will resume playback after the interruption
    • The player will use the skipBack setting when resuming, so for long interruptions, audio will be allowed to rewind back
  • If plugging in headphones, audio will continue in the headphones
  • If disconnecting headphones, audio will stop playing
    • There may be other scenarios we want to pause audio, but I'm not sure of them at this moment
    • We now have the framework to add others in the future

Note: This PR also includes #359 as there was a merge conflict that needed to be fixed between them. If you would like to review the code for this without #359, I can trigger an update to this PR after #359 is merged


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/advplyr/audiobookshelf-app/pull/361 **Author:** [@ronaldheft](https://github.com/ronaldheft) **Created:** 9/3/2022 **Status:** ✅ Merged **Merged:** 9/3/2022 **Merged by:** [@advplyr](https://github.com/advplyr) **Base:** `master` ← **Head:** `ios-audio-events` --- ### 📝 Commits (5) - [`20d9328`](https://github.com/advplyr/audiobookshelf-app/commit/20d932877ed5614d6f4348d64a32217ccd2c01ef) fix: Only mark audio session as active when playing - [`11f2288`](https://github.com/advplyr/audiobookshelf-app/commit/11f22888d541de2ac749dead4f2c03088b08fa73) feat: Handle resuming iOS audio after pause - [`82159ee`](https://github.com/advplyr/audiobookshelf-app/commit/82159ee537ede1a1ad0d0d2809fed7e59b755a63) feat: Handle route change notifications - [`d1c1902`](https://github.com/advplyr/audiobookshelf-app/commit/d1c1902cd38f54da10299c04afa077334f695f39) Merge branch 'bug-ios-sleep-timer' into ios-audio-events - [`c119778`](https://github.com/advplyr/audiobookshelf-app/commit/c11977870d525895f6f782f56f27292382a3d296) Merge branch 'advplyr:master' into ios-audio-events ### 📊 Changes **1 file changed** (+73 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `ios/App/Shared/player/AudioPlayer.swift` (+73 -1) </details> ### 📄 Description This PR addresses several issues (fixes #343): * The active audio session is now changed to `false` when the player is paused * This also ensures the below fixes do not trigger when the player is paused * When an audio interruption occurs (such as Siri, directions in CarPlay, a phone call, etc), if ABS was playing before the interruption occurred, ABS will resume playback after the interruption * The player will use the `skipBack` setting when resuming, so for long interruptions, audio will be allowed to rewind back * If plugging in headphones, audio will continue in the headphones * If disconnecting headphones, audio will stop playing * There may be other scenarios we want to pause audio, but I'm not sure of them at this moment * We now have the framework to add others in the future Note: This PR also includes #359 as there was a merge conflict that needed to be fixed between them. If you would like to review the code for this without #359, I can trigger an update to this PR after #359 is merged --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2026-04-24 23:58:17 +02:00
adam closed this issue 2026-04-24 23:58:18 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf-app#1416