Replies: 1 comment
-
|
You may fetch the Lottie file first, extract the import { DotLottie } from "@lottiefiles/dotlottie-web";
const animationUrl = "https://lottie.host/path/to/animation.json";
fetch(animationUrl)
.then((res) => res.json())
.then((animationData) => {
const op = animationData.layers[0].op;
const in = animationData.layers[0].in;
const dotLottie = new DotLottie({
container: document.querySelector("#dotLottie-canvas"),
data: animationData,
loop: true,
autoplay: true,
segment: [in, op],
});
})
.catch((error) => console.error("Error loading animation:", error)); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I would like to be able to get the outPoint(the frame at which the Lottie animation ends at) and inPoint(the frame at which the Lottie animation starts at) value for a lottie animation. Based on these values I want to set the segment to be played by
player.setSegment(startFrame, endFrame). Tell me, is there any way to do this?Beta Was this translation helpful? Give feedback.
All reactions