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>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 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:
master← Head:ios-audio-events📝 Commits (5)
20d9328fix: Only mark audio session as active when playing11f2288feat: Handle resuming iOS audio after pause82159eefeat: Handle route change notificationsd1c1902Merge branch 'bug-ios-sleep-timer' into ios-audio-eventsc119778Merge 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):
falsewhen the player is pausedskipBacksetting when resuming, so for long interruptions, audio will be allowed to rewind backNote: 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.