简体   繁体   English

毕加索图像加载库:如何加载视频缩略图

[英]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. 而且我想使用Picasso来处理视频缩略图以及图像。 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 . 似乎我只需要创建像VideoHunter这样的自定义Hunter并使用它们从InputStream创建Bitmap 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? 或者fork库和修改BitmapHunter.forRequest只是处理Picasso中视频缩略图的方法吗?

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. 我担心为时已晚,但仍然是:Android的Glide库只能从URI / File加载视频缩略图,与图像几乎相同。

So all you need to do is: 所以你需要做的就是:

Glide.with(Context)
     .load(videoFile) // or URI/path
     .into(imageView);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM