Created attachment 300516 [details]
A simple project which show the problem of WKWebView and AVAudioSession
By setting app's AVAudioSession's category to `AVAudioSessionCategoryPlayback` with option `mixWithOthers`, will make sounds from video in UIWebView be mixed with third party background music (such as Spotify). It do not work at all once switch to WKWebView.
Tested on Xcode 8.2.1, iOS 10.2.1
This bug is annoying some of my app's users also because the webview ignores the hardware mute switch. Is there any hope of getting this fixed, or at least providing a property on wkwebview to set its audio session category?
We're unable to mix audio from WkWebView and AVPlayer as the webview audio takes precedence and ducks everything else. I really don't understand why WkWebView is so restrictive when it comes to media, i.e. getUserMedia and this audio issue.
getUserMedia works under WKWebView, but without any AudioSession manipulation.
That blocks as from using CallKit or applying any audio routing, modes and categories.
WebKit's setSinkId and enumerateDevices are still experimental so no impl for WebKit.
I hope these missing features will be developed soon and at least WKWebView's AudioSession will be added to its API.