Bug 256075
Summary: | WKWebView configuration mediaTypesRequiringUserActionForPlayback not working after iOS 16.3.1 update | ||
---|---|---|---|
Product: | WebKit | Reporter: | vaibhav garg <vaibhav.garg> |
Component: | Media | Assignee: | Nobody <webkit-unassigned> |
Status: | NEW | ||
Severity: | Normal | CC: | eric.carlson, jer.noble, vaibhav.garg, webkit-bug-importer |
Priority: | P2 | Keywords: | InRadar |
Version: | WebKit Nightly Build | ||
Hardware: | iPhone / iPad | ||
OS: | iOS 16 |
vaibhav garg
I am using WkWebView to display some dynamic content made in cocos creator game engine. For sound to play without user interaction I was using the "mediaTypesRequiringUserActionForPlayback" flag for WKWebViewConfiguration as '0' i.e. no user interaction is required to play audio/video.
The above setting was working fine and sound autoplay was working up untill iOS 16.0, after updating my iPad to iOS 16.3.1 the autoplay of sound stopped working. It can only be played if I call AudioContext.resume() on user interaction.
Can anyone advice how to get the audio autoplay working correctly again.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
vaibhav garg
Factory resetting the device fixes the issue, solution this extreme is not desirable
Alexey Proskuryakov
Given that a factory reset has fixed this, not sure if there is strong evidence that this is a general regression. Have you observed this on multiple devices?
Radar WebKit Bug Importer
<rdar://problem/108660861>
Eric Carlson
`configuration.mediaTypesRequiringUserActionForPlayback = WKAudiovisualMediaTypeNone` is used successfully in many WebKit API tests
vaibhav garg
This configuration is being used by our app since a long time and was working fine till iOS 16.3.1 and I did receive this issue on multiple device including company and customer iPads
Jer Noble
Can you verify that you're changing the value of `mediaTypesRequiringUserActionForPlayback` _before_ you call `-[WKWebView initWithFrame:configuration:]` and not after? Or better yet, give us a code snippet of your initialization logic?
vaibhav garg
WKWebViewConfiguration *configuration = [[WKWebViewConfiguration alloc] init];
[configuration setMediaTypesRequiringUserActionForPlayback:WKAudiovisualMediaTypeNone];
WKWebView *webView = [[WKWebView alloc] initWithFrame:[Constants landscapeScreenFrame] configuration:configuration];
Hi, above is the exact objective c code that i am using for web view initialization