Hey guys,
just having an issue if I try to play a file within the /public folder on my Cordova app. The sound doesn’t start playing. This is my simple code:
var audio = new Audio('/camera_shutter.mp3');
audio.play();
The funny thing is that an AJAX request gives me the full file:
I get an error object after 10 seconds. It has MediaError 4, which means source is not supported. But the ajax request provides the me full data of the file, including ID3 tags.
The most likely reason seems to be that the file is not (yet) loaded when the play method is called. But that will need some more debugging. Likely it waits when you enter the url because it understands an url would be asynchronous.