#Cordova Ringtone Picker Plugin# Ringtone Picker is a Cordova plugin for android that returns list of available ringtones
To install the plugin, use the Cordova CLI and enter the following:
cordova plugin add ringtonepicker
- Android
Update:
To show native ringtone picker, use the following code:
RingtonePicker.pickRingtone(successCallBack,errorCallBack);
successCallBack will have the URI of selected sound.
ErrorCallBack will have an integer representing following errors:
1 - User canceled operation
2 - Unknow error like returned URI was NULL
To get the list of available ringtones, use the following code:
RingtonePicker.getSoundsList(successCallBack,errorCallBack);
successCallBack will have a JSON Array of JSON Objects containing URI and name of sound.
To hide the dialog, use the following code:
RingtonePicker.playSound(soundURI);
soundURI is the URI of sound that you want to play.