Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Handle iOS audio events #361

Merged
merged 5 commits into from Sep 3, 2022
Merged

Conversation

ronaldheft
Copy link
Contributor

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

@ronaldheft
Copy link
Contributor Author

Synced this branch after the merge, so the PR shows only the code changed for this issue.

@advplyr
Copy link
Owner

advplyr commented Sep 3, 2022

I tested connecting/disconnecting headphones and it worked as you described.

I also tested with maps and the pause then seek back worked great.

@advplyr advplyr merged commit 1f2c309 into advplyr:master Sep 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Handle iOS system audio events and resume playblack when necessary
2 participants