我正在使用React Native库“ react-native-get-music-files
”在设备上获取音乐文件并收到错误消息“ Something get wrong with music cursor
”。
我正在使用“ then
”中的以下代码和控制台返回消息:
MusicFiles.getAll({
id: true, // works only when 'cover' is set to true
artist: true,
duration: true, //default : true
genre: true,
title: true,
fileName: true,
minimumSongDuration: 1000
})
.then(tracks => {
console.log(tracks);
})
.catch(error => {
// catch the error
});
预期输出如下:
[
{
id : 1,
title : "La danza del fuego",
author : "Mago de Oz",
album : "Finisterra",
genre : "Folk",
duration : 132132312321, // miliseconds
cover : "file:///sdcard/0/123.png",
blur : "file:///sdcard/0/123-blur.png", //Will come null if createBLur is set to false
path : "/sdcard/0/la-danza-del-fuego.mp3"
}
]