cordova-plugin-nativeaudio: iOS, preloadSimple: "Asset Not Found" on http assetPath
Steps to reproduce
Try this:
window.plugins.NativeAudio.preloadSimple('music','http://incompetech.com/music/royalty-free/mp3-royaltyfree/Furious%20Freak.mp3',function(a){console.log("ok",a);},function(b){console.warn("no",b);});
(Or, upload your own MP3 to your own server and point to that path.)
Expected result
The file has been preloaded so that I may play it back
Actual result
The console logs the warning no – "(NATIVE AUDIO) Asset not found. (http://incompetech.com/music/royalty-free/mp3-royaltyfree/Furious%20Freak.mp3)"
.
Notes
This was just tested in iOS Simulators for 8.x, 9.x, and 10.x. None of them work.
My only guess is that [[NSFileManager defaultManager] fileExistsAtPath : path]
does not check actual external URLs, so the preloadSimple. I’ve tried with a 3-minute song as well as a 5-second ‘sound effect’, and I receive the same error each time.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 16 (1 by maintainers)
www/http://192.168.3.189:8080/calls/...
is not a valid local file path.This plugin does not support remote audio resource, yet.
So, you need put the assets together with your js code.
@floatinghotpot I agree. But the documentation does state that it supports this. Wasn’t until I looked at the source that I confirmed it wasn’t supported Certainly is misleading
this is very frustrating, the documentation said that it works with URL, but this is not true.
spent the last two hours “troubleshooting” this thinking i had an issue on the server, because I believed the documentation when it said “relative path or absolute URL (inluding http://)” …
Yes would be nice to know, and also good to remove it form documentation.