Ashish Sahu
Ashish Sahu

Reputation: 388

How do I get Raw folder path in Android for react native?

I have searched alot but unable to find any solution for fetching up mp3 file from raw folder.

How do I get local mp3 path for playing mp3 from raw folder in Android.

I am using "react-native-audio-streaming" module.

this.chalisa = './song/shree_hanuman_ji_ki_aarti.mp3'

NO LUCK AT ALL :(

Upvotes: 3

Views: 1720

Answers (1)

Gandalf
Gandalf

Reputation: 13693

if you want to have real path,then do copy of stream taken from

ContentResolver.openInputStream()

You can read about it here https://commonsware.com/blog/2016/03/15/how-consume-content-uri.html

That being said, i found this react native plugin to be of help in cases when you just want to grab the path like you want https://github.com/luisfuertes/react-native-file-picker

Hope that helps.

Upvotes: 1

Related Questions