hi
i placed an mp3 file in music directory storage/emulated/0/Music/music.mp3 and use file:// prefix for load this but it doesn't work (shows in notificationbar but not playing)
code:
await TrackPlayer.add({
id: 'track',
url: 'file://storage/emulated/0/Music/music.mp3',
title: 'Despacito gg',
artist: 'Luis Fonsi Feat. Daddy Yankee',
artwork: 'http://images-eu.ssl-images-amazon.com/images/I/61JH2ggghmL._AC_US160_.jpg'
});
TrackPlayer.play();
whats wrong?
You're on Android, right?
@Guichaguri yes
@msabaeian Just tested here, and it works for me.
Try which three slashes, like so: file:///storage/emulated/0/Music/music.mp3
@Guichaguri im trying with three slashes and it doesnt work:
`await TrackPlayer.add([{
id: "1",
url: "file:///storage/emulated/0/Downloads/music/Yummy.mp3",
title: "Yummy",
artist: "Justin Bieber"
}]);
TrackPlayer.play();`
Yes local mp3 not playing with /// or with this //. Did anyone found solution?
@ajoykarmakar yes, if you are using it in Android X, allow permissions first, read external and edit external storage then add in AndroidManifest in application this: android:requestLegacyExternalStorage="true"