Closed theashraf closed 7 months ago
I'm interested to contribute to the project, may I take this ticket?
Thanks, @jk-gan, for your interest. Feel free to pick it up, and please let me know if you need any help or are facing any issues
@theashraf I'm now starting to look at this. May I get more details about this issue?
@jk-gan
The dotlottie-rs
crate includes a module named dotlottie_player.rs
, which contains the DotLottieRuntime
and DotLottiePlayer
structs. We need to introduce a new method to both called active_theme_id
that will return the ID of the currently loaded theme.
DotLottiePlayer
is the thread-safe version ofDotLottieRuntime
.
How themes are loaded by their IDs in the player:
load_theme(theme_id: &str)
which returns true
upon successful loading of the theme, and false
otherwise.In the dotlottie-ffi
crate, we need to update the .udl
files to add an FFI (Foreign Function Interface) for the active_theme_id
function that was added in the dotlottie_player.rs
module. This will make the newly added function available to the Kotlin/Swift/C++ bindings.
You may refer to this document on UniFFI UDL syntax: https://mozilla.github.io/uniffi-rs/udl/interfaces.html.
Lastly, we need to update the emscripten_bindings.cpp
module in the dotlottie-ffi
crate to port it to WebAssembly (WASM).
You can use the demo-player
crate for testing the newly added method, and also don't forget to update the tests.
This document will help you understand how our build system works: https://github.com/LottieFiles/dotlottie-rs/blob/main/BUILD_SYSTEM.md.
Thanks @theashraf. I tried to run the demo-player
, but it panic because the CARGO_MANIFEST_DIR
not present.
I've run make mac-setup
and also make demo-player
. Am trying to look at the cause of this.
@jk-gan, we don't have a proper workspace setup yet, so you'll need to navigate to the demo-player
directory by running cd demo-player
before executing cargo run
May I know what should I expected when running the demo-player
? because what I saw is just a blank window.
@jk-gan, everything is functioning correctly now. If you press the p
key, the animation will start playing 👍🏼
Ahhhh, I see. Ok, saw the animation now!