ng-lottie icon indicating copy to clipboard operation
ng-lottie copied to clipboard

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

Open ofirrifo opened this issue 6 years ago • 3 comments

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 https://github.com/airbnb/lottie-web/issues/1479

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

ofirrifo avatar Jan 31 '19 08:01 ofirrifo

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

marcjulian avatar Feb 11 '19 18:02 marcjulian

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

Snowbases avatar Aug 07 '20 08:08 Snowbases

@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);
}

marcjulian avatar Aug 07 '20 08:08 marcjulian