Greetings, i have a problem with embedded youTube videos. It worked fine sometime ago, and works fine on Android. But i started getting user feedback, telling me something was wrong, so i did some tests…
When a video is muted the video plays fine, but if it is not muted, it will stop, and throw an error. So if i add &mute=1 to my embeded youTube url, the video plays. But when mute=1 is not added, it breaks instantly.
I have tested on 2 iPhones and 1 iPad Pro, same issue on all 3 devices, currently running softwareversion 13.3.
This is the error that is thrown and shown in Xcode:
I have tried enablind/disabling all sorts of permissions. I tried looking through CDVWKWebViewEngine.m since i suspect there are some errors there. But in the end, it might be some simple permission i need to enable… or even some iOS related setting the user needs to enable/disable.
I really hope someone else have a solution to this problem, since it frustrates me a great deal. If not a solution, at least some ideas… thanks!
Thank you for your reply. I have indeed looked through the docs, and changed some parameters, but besides going from fullscreen to inline play, there isn’t much that seems iOS related.
I still suspect it is an issue with iOS 13+, since it used to work just fine previously.
I will do some more tests on a completely clean project today.
I figured out my issue, it was with the plugin cordova-plugin-background-mode.
I fixed the iOS issues and are using a fork of said plugin now.
So, if anyone have issues with music player sound stopping on iOS when you are opening your app, or have issues with unmuted embedded videos not playing correctly, you might also have issues with the cordova-plugin-background-mode plugin.
thanks for sharing. it does fix the issue of playing in background but it breaks music controls plugin. if i do not use the fork you recommended music controls plugin works but audio stops. when i use the fork you recommended the audio plays but music controls does not work. any ideas of why this is happening or any idea how to fix this?
If you look in Xcode you will se it still gives an exception, so… this is definitely not a 100% complete fix. I will take a look this week, see if i can fix the music control issue - and hopefully the exception itself (from my first post). Everyone else are welcome to join in…
I am using HTMLAudioElement for playing audio. In my case audio plays but I am unable to change the volume of the playing audio. And I still see that exception in xcode as @JBalslev said.
And I don’t use plugin cordova-plugin-background-mode.
Please provide me a solution for this.