by dheera · 5y ago · 0 comments
<video width="320" height="240" autoplay loop playsinline muted>
<source src="foo.mp4" type="video/mp4">
<source src="foo.ogg" type="video/ogg">
<!-- GIF fallback for ancient browsers but it's 2021 and you probably don't need this anymore -->
<img src="foo.gif" width="320" height="240">
</video>
With H.264 or any modern codec you'll get 24-bit color and smaller file sizes than GIF. It's better in every way I can imagine.There are still situations where you want a gif. Your approach works fine if you're writing your own code, but if I want to embed a looping animation on a Confluence page, it isn't a viable option.