Moti
Moti

Reputation: 492

Play video via Glide

I want to play video via Glide by load image from URL to image view. , I try to refresh the image by calling to the same URL with the following code:

Glide.with(context)
     .load(imageUrl)
     .apply(RequestOptions.skipMemoryCacheOf(true))
     .apply(RequestOptions.diskCacheStrategyOf(DiskCacheStrategy.NONE))
     .into(imageView);

How to do it in loop??? always I get an exceptions

Upvotes: 2

Views: 14364

Answers (7)

Victoria Klimova
Victoria Klimova

Reputation: 2825

I would recommend using VideoView, it has setVideoURI() method

Upvotes: 0

Vishal Bhut
Vishal Bhut

Reputation: 122

Play WebP Video On Glide

Transformation<Bitmap> circleCrop = new FitCenter();
            Glide.with(mContext)
                    .load(videoModel.getSmallThumb())
                    .optionalTransform(WebpDrawable.class, new WebpDrawableTransformation(circleCrop))

                    .into(myViewHolder.ivThumb);



implementation 'com.github.zjupure:webpdecoder:2.0.4.13.1'

Upvotes: 1

MBH
MBH

Reputation: 16639

The question Link on Github:

I quoted a comment done by Member developer of Glide @sjudd:

That's correct, we do not support playing videos. Unfortunately playing videos on Android is enormously complex and must remain out of scope for Glide.

I guess what it can do is playing thumbnail that you should have been created already on your server as GIF. so you send the link to that GIF and Glide will play it. It wont play video.

Upvotes: 6

mitesh makwana
mitesh makwana

Reputation: 279

No, it can only play GIFs, and show video thumbs. please check this for more support

Upvotes: 1

Ahsan bhatti
Ahsan bhatti

Reputation: 7

You cannot do this with Glide. I would recommend to Read documentation of android MediaProjection library Api.

Upvotes: 0

Matin Gdz
Matin Gdz

Reputation: 217

Glide is a library for showing and caching images in android and it's not usable for videos.

Upvotes: 0

SergeyBukarev
SergeyBukarev

Reputation: 1618

As far as I know Glide is for images (including anim GIF), but doesn't support playing videos. You can get thumbs, but no more.

Upvotes: 0

Related Questions