Safari on iOS 10 Brings Improved Support for Animated GIFs

Apple is updating its policies for video elements to give more control over media playback to web developers. The changes aim to put a stop to autoplay videos and improve support for animated GIFs inserted in websites. The changes, which will take effect with iOS 10, were outlined as new policies for video elements by Noble in a new blog post on the Webkit blog.

Animated gifs

It turns out that people these days really like GIFs. But the GIF format turns out to be a very expensive way to encode animated images when compared to a modern video codec like H.264. We’ve found that GIFs can be up to twelve times as expensive in bandwidth and twice as expensive in energy use. It’s so expensive that many of the largest GIF providers have been moving away from GIFs and toward the “video” element. Since most of these GIFs started out their lives as video clips, were converted into animated GIFs, and were again converted back to video clips, you might say that the circle is complete.

iOS 9 users may have already experienced that videos only begin playing when a user requests it to do so via a gesture. The new policy was born out of the need to improve the experience for animated GIFs: when you launch the animated GIF inserted into the Webkit blog post on your iPhone, you first need to press the play button and then the “video” element will enter fullscreen mode when starting playback.

With iOS 10 Apple aims to simplify this process, but to do that it needs to relax is video policies, hence the post explaining the move. The next generation iOS, which launches this fall, will allow videos with no audio element or a muted audio element to “honour autoplay attributes”, which means animated GIFs won’t require action on the part of the user to play. Videos which use the “video playsinline” element will also be able to play, and will not automatically enter fullscreen mode when the playback begins.

Apple says its earlier policy to require a user gesture for animated GIFs were for the sake of saving battery life, but given the popularity of GIFs, it came at a cost. That will change with iOS 10 this fall. You can read the new Webkitvideo policies as well as examples on the Webkit blog.