New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
play local video not work #831
Comments
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. @sjudd is this correct? Check http://code.tutsplus.com/tutorials/streaming-video-in-android-apps--cms-19888 on how to play videos. |
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. |
@sjudd Is there a way, though, to make a Drawable out of a video (even use ExoPlayer if needed), that will be possible to be drawn without SurfaceView/TextureView ? |
It may be possible, but efficient video playback is definitely out of scope for Glide. If you're interested you may be able to write an integration library that allows video playback, but it's not something I'd want to maintain as part of this library. |
I see, but I wish to say this: Glide was developed to handle image files initially, and got a lot more than that over the years. Now it can handle GIF animations and even WEBP animations (using GlideWebpDecoder library) . And I'm sure there will be a heic support in the future somehow, maybe by using the new ImageDecoder class of Android, which is expected to be a part of the support library of Google. There is also animated PNG, but I never saw it and I don't think there are many people who need/want it. Animation content is a kind of video, just without audio. That's also why a lot of websites use WEBM/MP4 instead, as they can sometimes present a better solution. Sometimes they even say it's GIF, even though it's not. Here are some examples: https://giphy.com/gifs/hot-funny-cartoon-fBEDuhnVCiP16/media - shows GIF, WEBP, and MP4 files . On this case, the MP4 file took 320K and yet the WEBP file took 1.21MB https://9gag.com/gif - says it's GIF, and probably started as such but usually it's actually webm . https://gfycat.com/ - has mp4 files https://imgur.com/gallery/ywKZuaB - sometimes GIF, sometimes mp4 files And I'm sure there are a lot more. And it's not just popularity or quality of the animation files. There are articles that claim it's also the expected file size and expected to take less CPU while showing it. See here comparison of WEBM vs GIF: As I've read, there is the "gifv" extension too, which as I've read is actually video file in disguise (mp4/webM) So I hope you understand that there is actually a need for those too. Maybe it's possible to handle the video files the same as GIF animations, and take a frame-by-frame solution ? |
I use Glide load a local video ,but the video not play. my code as below:
mImg
just anImageView
where is the mistake, any one any tips?
The text was updated successfully, but these errors were encountered: