Events
Enumerates the Lottie React events that you can use to capture playback status.
Use the addEventListener
calls to listen to the following exposed events.
Name | Description |
---|---|
| Animation data is loaded. |
| Animation instance has been saved to state inside the react-player. Use this event to call playerRef.current.play(), playerRef.current.pause() etc.. |
| An animation source cannot be parsed, fails to load or has format errors. |
| Animation data is loaded and player is ready. |
| Animation starts playing. |
| Animation is paused. |
| Animation is stopped. |
| Animation is paused due to player being invisible. |
| An animation loop is completed. |
| Animation is complete (all loops completed). |
| A new frame is entered. |
As an example, the following code demonstrates how to capture the load event and play the animation:
Last updated