Summary: | WKWebView seems to ignore AVAudioSession category settings in iOS app | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Victor Wang <wangshengjia01> | ||||
Component: | Media | Assignee: | Nobody <webkit-unassigned> | ||||
Status: | NEW --- | ||||||
Severity: | Normal | CC: | distinctdan, eric.carlson, haimomesi, jer.noble, mary, roger, webkit-bug-importer, youennf, znelson | ||||
Priority: | P2 | Keywords: | InRadar | ||||
Version: | Other | ||||||
Hardware: | iPhone / iPad | ||||||
OS: | iOS 10 | ||||||
Attachments: |
|
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. It's been 5 years and this still has not been addressed. Our users continue to complain about this issue. Someone please prioritize a fix. |
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 Many thanks.