DEV Community

Discussion on: Start and stop a llama! How to create a non-autoplay GIF web component πŸŽžοΈπŸ›‘πŸ”₯

Collapse
 
joelbonetr profile image
JoelBonetR πŸ₯‡

You understood it correctly. I was thinking off it because I don't usually work with GIFs but I remembered a pair of concepts from a post.
Now I double-checked it and probably .gifv format can help you to reach that easier.

Context and information:

GIF is a popular format for sharing short animation loops on the web, which includes sites such as 9gag, Imgur and Twitter.
The GIFV format is part of Imgur's "Project GIFV" initiative to improve the GIF format. One of the main upgrades of the format is that GIFV files are significantly smaller than GIF files, which enables faster loading speeds.

A GIFV file is a video file saved in a format developed by Imgur that improves upon the GIF format. It contains video compressed in the H.264 format and stored inside an .MP4 file container.

It lets you right-click to "show controls" and I bet there should be a way to programatically make it the default.
You can see gifv in use inside imgur (obviously) and in 9gag as well :)

Thread Thread
 
thormeier profile image
Pascal Thormeier

Very good point! I haven't worked with GIFV before, but I'm glad to see that things like these get institutionalized in modern browsers. I've actually found a Firefox ticket that wants to add video controls for all animated images, but that thing's open since 12 years: bugzilla.mozilla.org/show_bug.cgi?... - perhaps this will come one day, just like the controls for the HTML video tag. I'd really love to be able to add controls and steer it with some attributes, that would be amazing!

Thread Thread
 
joelbonetr profile image
JoelBonetR πŸ₯‡

Well, some of those things require a more in deep refactor and probably, the format itself can't expose this behaviour for the browser to implement/use. In fact, gifv adds those capabilities to animated gifs so I assume that it's the way to go.

If you've a site where you allow users to upload animated gifs, you can convert gif to gifv format on the fly and store this last one, so you standarize the output while allowing both formats as input.

This has been done in the past and in the present as well for different formats.
E.g: I can remember converting xls and xlsx to csv for convenience on working with CSV only internally inside the webapp but also having the opposite of converting this internal csv to xlsx just for user to download.
Same on allowing microsoft word, open document and so on but storing that as rich text and parsing the output into PDF.