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

play(fromFrame:toFrame:) doesn't work properly with CA rendering engine #2386

Closed
siddharth952 opened this issue Apr 18, 2024 · 2 comments
Closed

Comments

@siddharth952
Copy link

siddharth952 commented Apr 18, 2024

Which Version of Lottie are you using?

Lottie 4.4.2

Expected Behavior

When calling play(fromFrame:toFrame:completion:), I expect Lottie to play the animation in the given frame range properly but it somehow plays the last frame at the last for some reason

Actual Behavior

It should play the last frame in the range given

Animation JSON

Cannot share

Steps to reproduce

We need to use a Lottie file with IP = 30
eg:
{"v":"5.9.0","fr":30,"ip":30,"op":210,"w":360,"h":270, .. }

Seems to occur if we use the CoreAnimation rendering engine
LottieConfiguration.shared.renderingEngine = .coreAnimation

We would need to use a lottie which has two states eg:

Processing State (Frame: 0 to 100) -> This would be in autoReverse LottieLoopMode
Final State (Frame: 101 - 200) -> This would be in playOnce LottieLoopMode

Now we use the following code to play from an specific frame range:

private func playAnimation(){
        animationView.animationSpeed = 1
        if fromFrame >= 0 {
            animationView.play(fromFrame: fromFrame ,toFrame: toFrame, loopMode: loopMode) { _ in }
        } else {
            animationView.loopMode = loopMode
            animationView.play { _ in }
        }
    }
@calda
Copy link
Member

calda commented Apr 25, 2024

For us to investigate, share a sample animation and sample code that demonstrates this issue.

Copy link

github-actions bot commented May 3, 2024

This issue is stale because it is marked "can't reproduce" and has had no activity in the past week. Please comment with additional information, or this issue will be closed due to inactivity in one week.

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

No branches or pull requests

2 participants