react-lottie
react-lottie copied to clipboard
feat(index): add subFrame so that enterFrame callback matches ae frames
lottie-web supports a setSubframe(bool) method to allow you to request that the enterFrame callback is only called back on the exact afterEffects frame. I have a usecase where I need to play audio at exactly certain frames from my lottie json, so I need this exact callback match.
This PR adds a property called isSubframe that calls the setSubframe method of the lottie-web animation.
There's a bug with lottie-web where it doesn't 100% respect this property right now, but if I set it false currently and even though it calls a few extra times, it does give an explicit frame by frame callback for each frame so I get what I need. https://github.com/airbnb/lottie-web/issues/967