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

Frame support #44

Open
vlowe85 opened this issue Feb 7, 2019 · 3 comments
Open

Frame support #44

vlowe85 opened this issue Feb 7, 2019 · 3 comments

Comments

@vlowe85
Copy link
Contributor

vlowe85 commented Feb 7, 2019

Support setting the progress by frame and playing segments.

I think the following should be available:

setProgressWithFrame(frame)
playFromFrame(startFrame, endFrame)
@bradmartin
Copy link
Member

Nothing here on readme to achieve that? @itstheceo did a lot of work lately with progress and aligning the plugin with the native SDKs. Maybe he has some info here 👍

@itstheceo
Copy link
Contributor

This should be possible although some work would have to be done around aligning the underlying APIs as I can't see a uniform way of achieving it from my brief look at comparing LOTAnimationView.m and LottieAnimationView.java

iOS has nice support for this through playFromFrameToFrame seen here

On Android you would probably have to use setMinAndMaxFrame seen here and then subsequently handle playing it afterwards, and resetting things when other APIs are used afterwards. This is the approach I used for playAnimationFromProgressToProgress however I have noticed some issues when using it repeatedly in succession, where the native view can get into illegal states. For example animating from 0 to 50, then from 50 to 40. I need to invest some time into making this more robust but have been busy.

@bradmartin
Copy link
Member

Thanks for the info @itstheceo 😄 much appreciated. If I find time, I'll look into it.

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

No branches or pull requests

3 participants