Hacker News new | ask | show | jobs
by imaginariet 1770 days ago
From a linked article:

> It would be great if web browsers would accept in an <img> tag all the video codecs they can play in a <video> tag, the only difference being that in an <img> tag, the video is autoplayed, muted, and looped. That way, new and masterful video codecs like VP9 and AV1 would automatically work for animations, and we can finally get rid of the ancient GIF format.

Of course, the typical rebuttal on HN will be "I hate autoplay, nothing should autoplay without an explicit click", which is why we'll be stuck with GIF for another 10 years.

6 comments

Safari already accepts MP4 in an <img> tag and it is autoplayed, muted and looped [1]. Sadly, Chrome doesn't want to implement it [2].

[1] https://developer.apple.com/documentation/webkit/delivering_...

[2] https://bugs.chromium.org/p/chromium/issues/detail?id=791658...

This is a great example for the “Chrome is the new IE” debate: that’s a feature which would immediately make the web better but they held back support for a standard, hardware-accelerated format trying to force mainstream adoption of their own format which had limited tool support and never performed enough better than JPEG/PNG to be worth the trouble for most sites.
s/better/worse/
You think it's good that people keep using gigantic GIF files rather than smaller videos? There's no technical reason to prefer the GIF format — it burns data transfer, requires more CPU, and has terrible quality.
I prefer <img> elements never to animate at all, regardless of format. Animations should use <video>.
> Of course, the typical rebuttal on HN will be "I hate autoplay, nothing should autoplay without an explicit click", which is why we'll be stuck with GIF for another 10 years.

Why? If you believe nothing should autoplay GIFs are also part of the problem.

Absolutely; I consider GIFs autoplaying to be a bug—unfortunately a bug that would be rather difficult to fix.
It's easy to fix with the right browser. For instance with the Chromium-based Vivaldi, I configured "Image Animation" to "Once", with the other possible values being "Loop" and "Never". You may define a shortcut key to change this setting on the fly.
That doesn’t fix undesired animated image autoplay, it breaks animated images completely, since you can’t trigger playback on demand like you can with videos.
I personally find animated gifs on things like YouTube community posts visually distracting, as my eyes will continually move to look at what is moving. That's also why I turn off things like the moving tile images on the Windows start menu.
There are many valid reasons why autoplaying videos should be up to the user.

I'm generally against autoplaying, but I do accept that in some cases it is a nice thing.

So this proposal seems reasonable, if the browsers in addition get a separate option to disable this behavior.

It's important though that javascripts can't override this behavior to prevent abuse (say by unmuting), so browsers would have to take some precaution against that.

AFAIK Autoplay works fine in modern browser for video tags, just without sound. Enabling it for images does not alter web in any meaningful way IMO.
I really can't understand why we now have both autoplaying video against the users' wishes and incredibly complicated configuration whether to allow autoplay [0].

[0] https://developer.mozilla.org/en-US/docs/Web/Media/Autoplay_...

Because the ad industry pays for the browser.
I hope most would be okay with it due to the forced (by the browser) muting, i.e. images may animate but they may not make sound, even if they are displaying what is in reality a video stream containing sound.

At least I would be fine with that, and I can be quite annoyed with auto-playing video.