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

Add Sound.setActive and Sound.setMode for iOS AVAudioSession support #234

Merged
merged 1 commit into from
Jul 26, 2017

Conversation

jamesreggio
Copy link
Contributor

AVAudioSession has a mode parameter that is designed to work in tandem with a category to determine the OS-level mixing behavior across multiple app's sessions.

This PR adds support for setting the mode parameter in a manner similar to category. It includes type annotations and documentation.

This PR also adds support for invoking setActive on the AVAudioSession, which is something that has been lost in the deprecation of the enable and enableInSilenceMode methods. setActive is an important mechanism for signalling the interruptibility of the current app. I considered just calling setActive: YES within setCategory, but in light of the addition of setMode, it makes more sense to have this as an independent method.

These aren't useful for 95% of apps (the simple use cases), but if you want to build an iOS app that is resilient to phone calls and other interruptions, these are important.

@zmxv zmxv merged commit 4ce2568 into zmxv:master Jul 26, 2017
@zmxv
Copy link
Owner

zmxv commented Jul 26, 2017

Excellent. Thanks!

@jamesreggio jamesreggio deleted the add-active-mode branch July 27, 2017 16:52
@jamesreggio
Copy link
Contributor Author

Thanks for merging, @zmxv. Would you mind cutting a release?

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.

2 participants