airbnb / lottie-web

Render After Effects animations natively on Web, Android and iOS, and React Native. http://airbnb.io/lottie/
MIT License
29.86k stars 2.85k forks source link

Add `setLoop()` method to update a running animation #2907

Closed renspoesse closed 1 year ago

renspoesse commented 1 year ago

Since playSegments() can already be used to change the loop segment on a running animation, I think it'd make sense to also have a public setLoop() method that changes the loop parameter of an animation without having to recreate the animation item.

You can already achieve this by setting animationItem.loop = true/false directly, but this isn't documented, nor does it work in the Web Worker.