Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Picasso image loading library: how to load video thumbnails

I have some videos stored on device locally. And I'd like to use Picasso to handle video thumbnails also along with images. How I can do this?

Seems to be I just need to create my custom Hunter like VideoHunter and use them to create Bitmap from InputStream. But I didn't found any way to set my custom Hunter.

Or fork library and modify BitmapHunter.forRequest is only way to handle video thumbnails in Picasso?

like image 541
Oleksii Masnyi Avatar asked Dec 23 '13 10:12

Oleksii Masnyi


People also ask

How will you load an image into an imageView from an image URL using Picasso and display a custom image if there is an error while loading the image?

Image loading using Picasso is very easy, you can do it like this way Picasso. get(). load("http://i.imgur.com/DvpvklR.png").into(imageView); and in their website you can get every details. In your case you can parse every image URL and use RecyclerView to show them along with Picasso.


1 Answers

I'm afraid it's too late, but still: Glide library for Android is able to load video thumbnails just from URI/File, pretty much the same way as Images.

So all you need to do is:

Glide.with(Context)
     .load(videoFile) // or URI/path
     .into(imageView);
like image 178
Roman Golyshev Avatar answered Oct 05 '22 16:10

Roman Golyshev