capacitor-community / capacitor-community/native-audio

On iOS make the AVAudioSession.Category configurable to support the silent switch

Open
#22 7 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
154
Forks
78
PR merge metrics
No merged PRs in 30d

Description

**Is your feature request related to a problem? Please describe.**
When playing audio with iOS, users expect for apps to silence the audio when the physical silent switch is toggled off.

This is supported in the API by setting the appropriate category on AVAudioSession.sharedInstance().setCategory which is hardcoded to "playback" in the plugin.

**Describe the solution you'd like**
Add a configuration parameter for iOS, perhaps in preloadComplex to set the iOS Audio Session category

**Describe alternatives you've considered**
Remove AVAudioSession.sharedInstance().setCategory from the plugin and let each app set it's own category in AppDelegate.

**Additional context**
See documentation here: https://developer.apple.com/documentation/avfaudio/avaudiosessioncategory

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.