Using videos in img html

472 views Asked by At

Referencing this article: https://cloudinary.com/blog/evolution_of_img_gif_without_the_gif

What is the compatibility situation with videos in img in 2020? I don't know what the name of the feature is called to look for in caniuse.

  • Now you can <img src=".mp4">s in Safari Technology Preview
  • Early results show mp4s in tags display 20x faster and decode 7x faster than the GIF equivalent - in addition to being 1/14th the file size!
  • Now we wait for the other browsers to catch-up
2

There are 2 answers

0
Joel Lacerda On

By today (Oct 2022), we still can only use <img src=".mp4"> on Safari. If you want to make MP4 files work like GIFs on other browsers, you might wanna use <video autoplay muted loop>.

0
Flimm On
  • MP4: <img src="foo.mp4"> only supported in Safari
  • Animated GIF: <img src="foo.gif"> supported in all modern browsers
  • Animated WebP: <img src="foo.webp"> supported in all modern browsers