LottieFiles / dotlottie-rs

A universal, high-performance Lottie and dotLottie player built with Rust. Offers smooth rendering across platforms, low resource consumption, and extensive compatibility. Features FFI bindings for Kotlin, Swift, and WASM for seamless integration in Android, iOS, and Web projects.
https://developers.lottiefiles.com/docs/dotlottie-player/
MIT License
146 stars 8 forks source link

feat: accept activeAnimationId as part of the Config #182

Closed theashraf closed 2 months ago

theashraf commented 2 months ago

The default activeAnimationId is set to either the first animation in the .lottie file or the animation ID specified in the manifest.activeAnimationId. Currently, when load_dotlottie_data is called, this default behavior cannot be overridden. This means users need to make an additional request using the load_animation method to load a different animation if needed.

To address this, we could introduce activeAnimationId to the Config. This would allow users to easily specify which animation should be loaded initially, simplifying the process.

related https://github.com/LottieFiles/dotlottie-web/issues/250

theashraf commented 2 months ago

If animation_id is included in the config, it would be difficult to determine whether a change in animation_id was successful. However, with the load_animation method, we can easily verify this.

It may not be necessary to introduce animation_id as part of the config; this can likely be abstracted by the frameworks, as demonstrated here.