WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
223733
Play h5 audio element in wkwebview will report error: Required client entitlement is missing
https://bugs.webkit.org/show_bug.cgi?id=223733
Summary
Play h5 audio element in wkwebview will report error: Required client entitle...
pengyong
Reported
2021-03-25 00:45:22 PDT
An error is reported when playing h5 audio or video elements in wkwebview: Error acquiring assertion: <Error Domain=RBSAssertionErrorDomain Code=3 "Required client entitlement is missing" UserInfo={RBSAssertionAttribute=<RBSDomainAttribute| domain:"com.apple.webkit" name:"MediaPlayback" sourceEnvironment:"(null)">, NSLocalizedFailureReason=Required client entitlement is missing}> Then the performance of the webview will become very poor, no response to any element click.This problem has affected our tens of thousands of users.The current solution is to call the client method to play audio.How to solve the problem fundamentally?
Attachments
Add attachment
proposed patch, testcase, etc.
Alexey Proskuryakov
Comment 1
2021-03-25 14:40:21 PDT
What is h5 audio? Can you please elaborate steps to reproduce?
Radar WebKit Bug Importer
Comment 2
2021-03-25 14:40:31 PDT
<
rdar://problem/75854010
>
pengyong
Comment 3
2021-03-25 19:11:54 PDT
1.There is an audio element and a button button in my HTML file. Click the button to play audio. ``` <body> <button onclick="handleClick()">PLAY</button> <audio id="audio" src="
https://ac-dev.oss-cn-hangzhou.aliyuncs.com/test-2022-music.mp3
"></audio> <script> function handleClick() { document.getElementById("audio").play(); } </script> </body> ``` 2.Create a wkwebview to load the html file in my demo APP. ``` class ViewController: UIViewController , WKUIDelegate{ var webView: WKWebView! override func loadView() { let config = WKWebViewConfiguration() config.preferences.javaScriptEnabled = true config.allowsInlineMediaPlayback = true webView = WKWebView(frame: .zero, configuration: config) //.zero webView.uiDelegate = self view = webView } override func viewDidLoad() { super.viewDidLoad() let myURL = URL(string: "
https://ac-dev.oss-cn-hangzhou.aliyuncs.com/test-2022-py.html
") let myRequest = URLRequest(url: myURL!) webView.load(myRequest) } } ``` 3.Click the button in the HTML to play the audio, and you can see the error report on the xcode. ``` iPadN[2133:855729] [assertion] Error acquiring assertion: <Error Domain=RBSAssertionErrorDomain Code=3 "Required client entitlement is missing" UserInfo={RBSAssertionAttribute=<RBSDomainAttribute| domain:"com.apple.webkit" name:"MediaPlayback" sourceEnvironment:"(null)">, NSLocalizedFailureReason=Required client entitlement is missing}> ``` 4.To sum up, this error will appear when playing audio or video in HTML. Then the app performance will drop a lot, and the interactive response will be very slow.
Radar WebKit Bug Importer
Comment 4
2021-03-27 02:54:01 PDT
<
rdar://problem/75917755
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug