14
votes

I have an animated GIF that I would like to use in React Native. I have it embedded in my app and playing, but I would like the ability to pause/play the GIF based on an event.

Is there currently a way to do this in React Native? I understand I can do this by using an MP4 instead, but I would like to keep the GIF if possible because it allows me to use transparency.

2
Did you found any solution? - Nainal

2 Answers

0
votes

closest i know would be to use lottie-react-native, get more deatils here. its has many props to control the animations, info here.

Hope this Helps!

0
votes

You could provide an alternative static image to show when pause is enabled, and hide the gif.