Closed RonnySchleicher closed 4 years ago
Sounds like you need an entitlement now based on:
reason: "Client is missing required entitlement">
But... there doesn't seem to be any entitlements for media playback. And according to one user on this thread:
Unfortunately, from iOS 13 this ability is under sytem entitlements, com.apple.multitasking.systemappassertions and com.apple.multitasking.unlimitedassertions, you can try it in simulator, no error in log. There is no way to launch it on device thought, as you need an Apple issued provision profile. So, all we can do is to hope that some future release will fix this.
I don't have a test device, so I can't really play around with this, just posting some relevant information I found while searching for potential solutions and/or workarounds.
Important NOTE:
This assertion also occurs in the iPhone simulator.
Hello. The problem is really very first. Are there any suggestions to solve it?
This worked for me, try playing a 1s silent audio file in "onDeviceReady":
let silence = new Audio('silence.mp3') silence.play()
@bkervaski I will try this out asap.
Is there any fix for this issue? i have same problem, not able to play audio in background and stops after 30 seconds -
domain: RBSAssertionErrorDomain; code: 2; reason: "Client is missing required entitlement"> { userInfo = { RBSAssertionAttribute = <RBSLegacyAttribute: 0x15b115da0; requestedReason: MediaPlayback; reason: MediaPlayback; flags: PreventTaskSuspend | PreventTaskThrottleDown | WantsForegroundResourcePriority>; } }
There was a known bug that affected iOS 13.1-13.5 with fix landing in iOS 13.6 that caused problems from audio playback from webviews.
https://bugs.webkit.org/show_bug.cgi?id=211394
No one in this thread has mentioned what iOS version they were experiencing this issue on, so it would be great if someone could help us identify that this bug is related to the WKWebView bug.
In my opinion it is not possible to play sounds in the old way. It is necessary to request a promise to allow a url to an audio file to be played.
https://webkit.org/blog/7734/auto-play-policy-changes-for-macos/
I solved the problem for myself by using the cordova-plugin-media https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-media/
Bug Report
If I use the cordova-plugin-wkwebview-engine and play a soundfile, i become follow assertion.
This is not nice but not the real problem.
If I install this app via the app store and the audio object of this sound file plays automatically without user action, for example after receiving an SIO message, the assertion causes the app to crash.
❗ The really deadly problem is that with Cordova and the cordova-plugin-wkwebview-engine I can no longer play sounds without direct user action when the App is installed over the official Apple App-Store! The App will be closed after crash! ❗
Note: The problem only occours if I use the cordova-plugin-wkwebview-engine, without everything is fine.
Steps to reproduce the Assertion in X-Code
Important NOTE: The assertion also occurs in the iPhone simulator. ❗
Install the newest X-Code Version 11.5 (11E608c) on your Mac with macOS 10.15.5
Create a fresh and new Cordova App for iOS. You can use follow script:
Open the X-Code Project and add follow line in the cordova index.html (project/Staging/www/index.html):
The complete changed index.html look like this:
Open the X-Code Project and add follow line in the cordova index.js (project/Staging/www/js/index.js):
The complete changed index.js look like this:
When I start the app on the iPhone (in this sample it is an iPhone X), the new button is showing.
After click the button follow message is showing in the X-Code
What is expected to happen?
No error message appeares.
What does actually happen?
The error message appeares.
Command or Code
see above
Environment, Platform, Device
Version information
see above
Checklist