@horatiu11 wrote:
Hello guys, I started building an app in Ionic for both iOS and Android. I need to play and record sounds in my app, so I first started to test how can i play sounds.
In order to do this, I used Cordova media plugin. I installed it, I created a js file to play a sound which looks like this:function playAudio(url) { // Play the audio file at url var my_media = new Media(url, // success callback function() {}, // error callback function(err) {} ); // Play audio my_media.play(); }
I located the file in the www/js folder and linked it in the index.html. After that, I am simply calling the function from one of the templates using "onclick".
Now, I know that this works since I tested it with an online URL and it proved to be fine. However, when I use a local URL, it doesn't work, nothing is played.I guess that my problem might be from the local url I provide: "sounds/Practice/heed3.mp3", where the sounds folder is a separate folder inside the www one. I guess that this might be from the way Android uses the paths. Can you please help me?
PS: When building on Android I get the following message before the build happens, it might be related: "could not remove directory (code EBUSY) : C:\work\AppDev\CALVin\platfroms\android\assets\www/tempates".
Thanks!
Posts: 1
Participants: 1