How to make animated GIFs work from Android WebView

不想你离开。 提交于 2019-12-04 00:33:21

Not supported YET. Read more about this here: http://code.google.com/p/android/issues/detail?id=3422

For large memory phones like Droid and Nexus One, the two-line change has been made in Froyo (unreleased) to enable animated GIFs. For small memory phones, the change is not trivial and did not make it into this future release.

As a workaround, if you are using a custom WebView, you can do these 2 things together:

Please note that this is not a solution for displaying GIFs, you must modify the content of the web, and convert/split GIF animations into different files (one for each frame) in any format (JPG, PNG, etc).

AFAIK, animated GIFs are not supported on Android except as movie clips played by MediaPlayer.

Animated GIFs are supported in Froyo (Android 2.2).

Use WebP format for Android.

https://developers.google.com/speed/webp/

There are several online utilities available, to convert animated GIFs to WebP format (http://www.zamzar.com/convert/gif-to-webp/ is one example).

Note that WebP is not supported on most of the other browsers so you may need to apply some logic to select GIF or WebP based on platform.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!