mifi / react-lottie-player

Fully declarative React Lottie player
MIT License
494 stars 52 forks source link

Looping over multiple segments will only loop the last segment #116

Closed furedal closed 7 months ago

furedal commented 7 months ago

I think this might be a general lottie-bug but notifying it here anyway to see if there is a proper solution.

My animation has 3 steps.

  1. A starting part, segments: [0, 16]
  2. Loading part: [[16, 40], [40, 16]] (forward and then backwards)
  3. End part: [16, 40]

The loading part consist of two segments where one goes forward and the other-one backwards.

When looping the second part, the animation frames goes correctly from 16->40->16 but then it keeps looping the last segment like this: 40->16, 40->16, 40->16

The expected behaviour is: 16->40, 40->16, 16->40, 40->16 etc...

mifi commented 7 months ago

could you try with plain lottie-web and see if the segments work there for the same animation?

furedal commented 7 months ago

Its the same behaviour.

I've found some responses in lottie-webs issues. It seems like that its an known behaviour. Just don't understand why. Seems like a bug to me :p Anyway, its not a ReactLottiePlayer bug really, so i'll close this issue and put an issue in lottie-web about it instead :)