Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop animation after one loop and display the last frame #1479 #43

Open
ofirrifo opened this issue Jan 31, 2019 · 3 comments
Open

Stop animation after one loop and display the last frame #1479 #43

ofirrifo opened this issue Jan 31, 2019 · 3 comments

Comments

@ofirrifo
Copy link

I want to stop animation after one loop and display the last frame
here is a StackBlitz example

when I use the lottie-web it does work as should example

I was open this issue first to lottie-web
airbnb/lottie-web#1479

it seems that need to update the package lottie-web to 5.4.3

@marcjulian
Copy link

https://github.com/fivethree-team/lottie give this a try. It uses lottie-web in version 5.4.3.

@Snowbases
Copy link

@marcjulian it's possible to stop/resume at any point?

@marcjulian
Copy link

@Snowbases you need a reference to the LottieAnimation

<fiv-lottie
  [params]="lottieParams"
  [width]="250"
  [height]="250"
  (animationCreated)="onAnimationCreated($event)"
></fiv-lottie>

You can keep an instance of the animation in your component and play and pause at any point.

onAnimationCreated(animation: LottieAnimation) {
    animation.play();
    animation.setSpeed(0.8);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants