Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lottie playback controls #89

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

kirb
Copy link

@kirb kirb commented Nov 8, 2024

Hi there! We found the Lottie control really useful to our project, thanks for maintaining it!

For our use case, we needed the ability to pause, resume, and skip through the animation, and also to have callbacks fired when the animation stops or loops.

This adds the following APIs:

  • Start() and Stop() - existing methods, now made public
  • Pause() and Resume() - same as above but retains the current frame
  • SeekToFrame(float frame) - skip to an exact Lottie frame number
  • SeekToProgress(float progress) - skip to frame by progress percentage value
  • AutoPlay - can be used to prevent immediate playback (default true so behavior remains compatible)
  • OnAnimationCompleted and OnAnimationCompletedRepetition event handlers - callback on animation stopping at the end, or completing a repetition.

@emmauss
Copy link
Collaborator

emmauss commented Nov 19, 2024

Sorry for the late review. Can you resolve the conflict?

@kirb
Copy link
Author

kirb commented Nov 19, 2024

No worries at all! I’ll get to it shortly 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants