I have an HtmlDrawable page with an animated GIF in it. Sometimes the GIF plays, other times it plays from the middle, but most of the time, it just shows the last frame (looks like it's not animated).
I know that the GIF can work because it seems to work sporadically- usually after I restart the app.
Is there some way to get the GIF to work consistently in the HTML embed?
The page also has a transparent background and so do the GIF - in case that makes any difference.
almost 9 years ago
We have not tested animated GIFs for HtmlDrawables. Our suggested way for an animated image like GIFs is AR.AnimatedImageDrawable. It allows you to set an sprite sheet image. A sprite sheet image includes all animation frames in a grid like layout and you define how big one frame is in pixels. With AnimatedImageDrawables you have the benefit of controlling the animation, e.g. setting different frames to animate and their playback speed. Please have a look at the "Image Recognition - Bonus Sparkles" example that inlcudes such an AnimatedImageDrawable. Another benefit of this is that it is more lightweight than a HTMLDrawable.