coil icon indicating copy to clipboard operation
coil copied to clipboard

Add support for MP4 videos

Open colinrtwhite opened this issue 4 years ago • 8 comments

It would be great if Coil could support short MP4 videos. MP4 is now commonly used for the same use case as GIF, however it's much more efficient. Similar to GIFs, we would have to buffer the video into memory so we wouldn't be able to support large/long videos.

This would not be a replacement for ExoPlayer, which should be used to handle long videos and any advanced functionality. Any Coil MP4 support would likely only support start/stop and how many iterations to repeat.

colinrtwhite avatar Dec 03 '20 20:12 colinrtwhite

Doesn't it already? https://coil-kt.github.io/coil/videos/

PeterTheOne avatar Jun 23 '22 13:06 PeterTheOne

@PeterTheOne That adds support for decoding individual video frames.

colinrtwhite avatar Jun 24 '22 02:06 colinrtwhite

Hi, @colinrtwhite any pointers on how to implement this? I am planning to take this issue and wanted to know upfront what I am getting into 😅

atulgpt avatar Feb 01 '23 20:02 atulgpt

@atulgpt I think the biggest challenge will be figuring out how to get MP4s to be represented as a Drawable. Ideally we could use MediaMetadataRetriever to decode the mp4 into a custom drawable, though there are probably design limitations there.

colinrtwhite avatar Mar 29 '23 04:03 colinrtwhite

Hi @colinrtwhite, Let me sync the project and see how the coil works. BTW, are there any talks or blogs that explain (or give pointers) the internal working of coli?

atulgpt avatar Mar 29 '23 15:03 atulgpt

@sagar-viradiya Gave a great talk on some of the internals here!

colinrtwhite avatar Apr 01 '23 21:04 colinrtwhite

how to use imageloader in compose AsyncImage

fansangg avatar Apr 19 '23 09:04 fansangg

@colinrtwhite Is there any timeline for this feature? I'm currently developing a project from scratch and I wanted to know if I should delay the video implementation so that I can do it using Coil.

vladmircan avatar Aug 11 '23 15:08 vladmircan