change the duration of animation and update the animation at runtime

I need a way to create a custom lottie animation, where I can change the duration of animation and update the animation at runtime. Basically, I want to build a loader using lottie to show the progress animation in case of any kind of downloading.