lottie animation is playing too fast
Asked Answered
C

4

11

I added demo animation to the web using lottie, but the playback speed is too fast. How do I get to normal speed? The link below is a problem animation.

problem animation link : https://saybgm.github.io/Lottie_example/

My animation : https://youtu.be/CcHT7VgUF38

After Effect aep file : https://drive.google.com/file/d/1YGqgiuU-hU5Raq2WXu3r1ZrCANXB_Gw9/view?usp=sharing

my code

var animate = lottie.loadAnimation({
container: document.getElementById("hello"),
renderer: 'svg',
autoplay: true,
loop:true,
path: 'animation2.json'})
Chloromycetin answered 24/5, 2018 at 2:24 Comment(2)
Post your current code so everyone can helpAthanasian
github.com/SayBGM/Lottie_example This is github link.Chloromycetin
A
20

I think the problem is inside the animation file, tried with the Lottiefiles preview, it looks the same as your code runs: https://www.lottiefiles.com/share/TNdLkQ

If you want to make it slower, call setSpeed (1 is the current speed, < 1 will make it slower):

var animate = lottie.loadAnimation({
  container: document.getElementById("hello"),
  renderer: 'svg',
  autoplay: true,
  loop:true,
  path: 'animation2.json'
});
animate.setSpeed(0.1);

From the document: http://airbnb.io/lottie/web/getting-started.html

Athanasian answered 24/5, 2018 at 3:54 Comment(0)
H
13

Also you can handle it on XML file. Go to the Lottie tag, then implement

app:lottie_speed="any number"
Hydrochloride answered 27/8, 2019 at 7:34 Comment(0)
C
1

You can also set the speed directly on the component if you are using react

<LottieView
  speed={0.2}
  ref={animation}
  loop={true}
  autoPlay={true}
  ...
/>
Charwoman answered 19/3, 2022 at 21:59 Comment(0)
M
0

If you are following the new way of implementing Lottie in React you can use it like this(similar to Michael's answer who got my upvote):

<Lottie
    options={defaultOptions}
    height={'100%'}
    width={'100%'}
    isStopped={false}
    isPaused={false}
    speed={0.25}
/>
Mountainous answered 31/5, 2022 at 18:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.