Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

lottie animation is playing too fast

Tags:

lottie

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'})
like image 842
SayBGM Avatar asked May 24 '18 02:05

SayBGM


2 Answers

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

like image 66
Tam Huynh Avatar answered Oct 25 '22 06:10

Tam Huynh


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

app:lottie_speed="any number"
like image 40
A.R.B.N Avatar answered Oct 25 '22 05:10

A.R.B.N