How to play a sound on iOS? (Ionic Media Documentation is very bad)

Hi everyone.

I’m currently trying to play a sound on iOS.

I first tried using the Native Audio plugin. Couldn’t get it to work. Turns out it according to this it doesn’t work (why, dear Ionic Team, keep it in the docs then)?

So I tried the solution mentioned there. I used Media.
Turns out this also doesn’t work and even after googling extensively I couldn’t get it to work.

The error I get is always:

Unknown resource '../../../platforms/ios/www/assets/audio/lecker.mp3'

Or some kind of variation of that depending on what I tried for the file path.
Does any one know how to get Media to use the correct ressource?
In my Ionic project the path to my file is:


And the path to the page where I use media is:


So the relative path should be:


Any help would be much appreciated!

1 Like

Push. Does anyone have an answer for this? It is really important for me…

Found it! After hours of struggle and the (very bad) documentation here is the filepath that worked:


Doesn’t make any sense, but works.

1 Like