Media Plugin

Can some tell me how to play audio mp3 files locally by placing it in assets folder in my app
I am new to ionic.

Hey,

have you tried to do this?

yes i have tried but its not working

this.sound = this.media.create('/android_asset/www/assets/sounds/beep.mp3'); // for android
this.sound = this.media.create('assets/sounds/beep.mp3'); // for ios
1 Like

What has worked for me is to put the audio file into the assets/ folder. The assets folder is “compiled up” with your program and installed with it on the device. So, e.g., try this:

<ion-content>  
     <audio controls src="assets/My_Audio_File.mp3">
     </audio>
</ion-content>

And put your My_Audio_file.mp3 file in the assets directory of your project.

ya thats right bro totally agree with you.

prepaidcardstatus