Documentation does seem to indicate that you can use a URL for the asset path, but I have no experience with that. I’ve been using the plugin in my app and it seems to work fine for playing locally stored audio.
Why did you define a provider instead of just loading the plugin and using the this.nativeAudio.preload call?
Is your audio URL reachable without any authentication?
Does it work without a provider but implemented directly?
Does your provider work with a local file?
I haven’t fixed it yet, but from what I’ve learnt, you need to load the Audio file within the App locally, then it works. The audio file can’t be stored on a remove server (like Google Firebase storage).
Did you manage to solve this? The documentation states that you can load a url instead of a file, but I’m stuck at this problem too
error: java.io.FileNotFoundException: www/{audioUrl}
I got it to work with mp3 files on IOS and ANDROID (and WEB/HTML5) by wrapping the preloadSimple and play methods in cordova ready, AND fixing a bug in the Josh Morony tutorial. He was passing the asset path to the play method, and should be passing the key instead. Here is my solution:
I call the preload on each page where a sound is played, so it’s very modular.
Solution
Cordova Native Audio plugin expects an assets “www” folder. But in an Ionic Capacitor project it’s named “public”.
As the plugin has this value hard coded, the solution in the link below tells you to dive in the plugin source code inside each platform and replace “www” with “public”.
Alternatively add a symlink from the “www” folder to the “public” folder in the android main/assets location.