Snaží načítať audio obrázok z adresy url s glide, ale nefunguje
Glide
.with(this)
.load("http://api.boleiachain.com/upload/musictest.mp3")
.apply(options)
.centerCrop()
.placeholder(R.drawable.ic_loading)
.into(civ_image);
a snažil som sa na to
public Bitmap coverpicture(String path) {
Bitmap bitmap=null;
MediaMetadataRetriever mediaMetadataRetriever = new MediaMetadataRetriever();
mediaMetadataRetriever.setDataSource(path, new HashMap<String, String>());
try {
final byte[] coverImage = mediaMetadataRetriever.getEmbeddedPicture();
bitmap= BitmapFactory.decodeByteArray(coverImage, 0, coverImage.length);
} catch (Exception e) {
e.printStackTrace();
}
return bitmap;
}
Glide
.with(this)
.load(coverpicture("http://api.boleiachain.com/upload/musictest.mp3"))
.apply(options)
.centerCrop()
.placeholder(R.drawable.ic_loading)
.into(civ_image);
funguje to, ale s oneskorením, ktoré nie je dobrá prax v recyclerView adaptér