想摆脱URL歌曲的专辑封面,这是我尝试至今:如何从URL获取歌曲的专辑封面
SongPath = "www.asd.com/music.mp3";
android.media.MediaMetadataRetriever mmr = new MediaMetadataRetriever();
try{
mmr.setDataSource(SongPath);
}catch(Exception e){}
byte [] data = mmr.getEmbeddedPicture();
if(data != null)
{
Bitmap bitmap = BitmapFactory.decodeByteArray(data, 0, data.length);
imageView.setImageBitmap(bitmap);
}
else
{
imageView.setImageResource(R.drawable.jak);
}
,但运行时该代码得到这样的:call to get embedded picture failed
,所以我研究这个有的人修复与改变这一部分
mmr.setDataSource(SongPath);
这个
mmr.setDataSource(SongPath,new HashMap<String, String>());
我这样做,但是当运行的应用程序图像视图显示什么,让这样的:SkImageDecoder::Factory returned null
注: 我能做到这一点使用FFmpegMediaMetadataRetriever
库(它像MediaMetadataRetriever
)和工作,但问题是库看起来很慢..唯一的方法它的平均4,5sec时间需要取图片,当添加这个库从1.8mb的apk文件成为24mb!这是如此之大!
所以世界上任何一个人都知道如何以良好的方式做到这一点?如果任何人可以请求帮助
哪里是URL,后整个东西 –
@LutaayaHuzaifahIdris当你没有足够的知识,这个不来这里和我的问题给反对票。我的问题和描述很明显,但似乎你很低,不能理解:) – Erf
你是什么意思的网址?是本地路径(即从SD卡)还是从Web? – MdFazlaRabbiOpu