Playing downloaded audio


I know how to create an audio player that loads and plays mp3 files directly from the web. There are lots of pages in my app, and each page has an audio player that plays audio relevant to the page. How would I make the player on a given page download the relevant mp3 to the local system the first time that page’s play button is ever clicked, and then whenever it is clicked again it would just play from the local system?
(I do not want to download the files the first time the app is opened. I only want it to download the file the first time if the play button on a given page was actually clicked.)