Select Audio files Using Media Picker
Rahul Pandey0.0.10
platforms: ios
$ cordova plugin add


The plugin allows you to select the song from iOS music library and copy it in your app Document directory. Then you can use the cordova media plugin to play the song. Check the demo on how to play a song via media plugin.


cordova plugin add

Methods & Usage

  • To select the song from music library

success - will be called when the user has done selecting the songs. You can get the array of songs list using this

    function success(data)

error - will be called if there are any errors in exporting or selecting the songs

    function error(e)

option - a string variable which allows you the disable multiple songs selection from the user. You can either pass 'true' or 'false'

    var options = 'true' // Will allow user to select multiple songs.
    var options = 'false' // Will allow user to select only one song.
  • To delete the song

option - To delete multiple files or single file. You can either pass 'true' or 'false'.

    var options = 'true' // Will delete multiple songs.
    var options = 'false' // Will delete only one song.

src - It depends on the value of option. If the option is true, then the src will be an array containing full path to file. Otherwise a string will single full path. The full path should not contain file://localhost or any encoded string like Value%20Space. It should start like this /var/mobile/....../file name.m4a. See demo for more information.