I have an android app written in cordova/ionic which has a requirement to show all music files in the device in a list. I am using cordova-file-plugin to recursively load the music files. I am using cordovaNativeAudio plugin to play these files. Some of these files are located in file:///storage/emulated/0/Ringtones/ But when i play these files using
$cordovaNativeAudio.play(“test”);
it is not playing. But the plugin works fine if the mp3 files are within the project (www/audio) folder.
Do i need special permissions to play the files outside the project ? These are my current permissions:
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
Do i need to transfer these files to my project to make it play? i tried both nativeURL and fullPath but to no avail.
nativeURL shows as “file:///storage/emulated/0/Ringtones/test.mp3”
fullPath shows as /Ringtones/test.mp3