Open jscontrust opened 7 years ago
I just made the config autoloadSegments: false
work in v0.2.1
Can you please try it, and give me some feedback? Thanks!
I have tried with that version but still same result. My lottieConfig is still same with autoloadSegments: false and version 0.2.1.
ng-lottie@0.2.1 node_modules/ng-lottie
Thanks for your feedback!
I repeated your case, and then I checked bodymovin's code.
The reason is that this.totalFrames
is overrided by asyn configAnimation
So, on consumer side setTimeout
could make the function wait after the overrides..
My suggestion is to replace load json file into module.exports js object, and set it to animationData.
let animationData = require('./assets/pinjump.js');
....
this.lottieConfig = {
animationData: animationData,
autoplay: false,
autoloadSegments: false,
loop: true
}
which will avoid the overriding..
I'm thinking how to make a patch of bodymoin#playAnimation
to avoid this inconsistent.
But If you still need external path to load json, setTimeout
is a correct choice :-)
Hi I am curious if this issue has been fixed to work properly yet? I am having the same issue
Also I cannot get the proper syntax for playSegments(). Console is telling me I need ':' instead of a comma?
I am implementing ng-lottie in my angular 4 app. I am trying to play a segment when the animation is created. But on creation, it plays the whole animation at first then loop through the segment. Here is my code -
Although I am able to find a solution by adding timeout in handleAnimation function. But I do not know if this is the correct way to solve this issue.
Just think that it has something to do with this issue https://github.com/bodymovin/bodymovin/issues/398