LottieAnimation
AnimationOptions
export interface AnimationOptions { id: string; autoplay?: boolean; direction?: number; loop?: boolean; data?: AnimationData; defaultActiveAnimation?: boolean; url?: string; playMode?: PlayMode; speed?: number;}data?: AnimationDataLottie animation data.
defaultActiveAnimation?: booleanIf true will be the first animation to play when loaded on a dotlottie-player with multiple animations.
url?: stringA URL of where to fetch the animation. The animation isn’t fetched when the LottieAnimation is constructed but on a call to DotLottie.build() or one of its export methods (toJson, toArrayBuffer, toBase64, toBlob).
Additional options
id: stringA unique id for the animation.
autoplay?: booleandirection?: number;Either 1 for forward and -1 for backwards playback.
loop?: boolean;playMode?: PlayModeCan either be 'normal' or 'bounce'.
speed?: numberAnimation playback speed.
Methods
Export and util methods
async toArrayBuffer({inlineAssets?: boolean}): Promise<ArrayBuffer>Returns the animation data as an ArrayBuffer.
async toBase64({inlineAssets?: boolean}): Promise<string>Returns the animation data as a Base64 encoded string.
async toBlob({inlineAssets?: boolean}): Promise<Blob>Returns the animation data as a Blob.
toJSON({inlineAssets?: boolean}): Promise<Animation>Return the animation data as a JSON object.
If the animation data is not already set, it will be fetched from the provided url.