Open doraorak opened 2 months ago
Do you have a specific use-case in mind that would not be covered by the existing API?
For example it would allow us to have normal output volume (instead of low) when using play-and-record category (https://developer.apple.com/documentation/avfaudio/avaudiosessioncategoryoptions/avaudiosessioncategoryoptiondefaulttospeaker?language=objc) or mix external audio (like spotify) with the wkwebview's audio while the ringer switch is on silent (https://developer.apple.com/documentation/avfaudio/avaudiosessioncategoryoptions/avaudiosessioncategoryoptionmixwithothers?language=objc)
Most importantly it would improve the coherence between native and web/hybrid applications
Thanks for the input, this is useful.
The first usecase is related to speaker selection, which is something AudioSession could tackle.
The second one is related to ongoing discussions on how a tab audio can mix with other tabs or other apps.
In ios there are multiple options to configure AVAudioSession instances (https://developer.apple.com/documentation/avfaudio/avaudiosessioncategoryoptions?language=objc). Since this API is just changing the Category of the AVAudioSession in the webprocess where WKWebView is getting rendered and playing audio, it only makes sense we should be able to set its options as well. Thanks.