NEW 167788
WKWebView seems to ignore AVAudioSession category settings in iOS app
https://bugs.webkit.org/show_bug.cgi?id=167788
Summary WKWebView seems to ignore AVAudioSession category settings in iOS app
Victor Wang
Reported 2017-02-03 02:57:33 PST
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.
Attachments
A simple project which show the problem of WKWebView and AVAudioSession (27.13 KB, application/zip)
2017-02-03 02:57 PST, Victor Wang
no flags
Radar WebKit Bug Importer
Comment 1 2017-02-04 00:17:35 PST
distinctdan
Comment 2 2019-11-22 15:50:47 PST
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?
zn
Comment 3 2020-06-09 00:38:54 PDT
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.
haimomesi
Comment 4 2021-08-29 14:33:55 PDT
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.
Mary
Comment 5 2022-11-10 08:36:52 PST
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.
dhonus
Comment 6 2025-02-12 23:45:11 PST
This still persists 7 years in, could this get higher priority? It's a pretty major roadblock. Is this documented anywhere?
Note You need to log in before you can comment on or make changes to this bug.