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

Player can go beyond the frame range #292

Closed
ishuvalov opened this issue Jan 15, 2024 · 4 comments · Fixed by #323
Closed

Player can go beyond the frame range #292

ishuvalov opened this issue Jan 15, 2024 · 4 comments · Fixed by #323
Assignees
Labels
bug Something isn't working

Comments

@ishuvalov
Copy link

ishuvalov commented Jan 15, 2024

On some animations player is stopped on the frame just after the actual last animation frame. Which leads to the empty player.

For example in this animation https://lottiefiles.com/animations/infinity-loading-blue-A8cLWc9JCH
Total animation frames: 28
The last frame to play: totalFrames - 1 = 27

If you visit the animation page using the link above and turn off the loop setting you see that the player stops on the right last frame (27) somehow (probably this case is specially handled on the web site), but the timeline still shows that there is one more frame and you can drag the seeker on it manually.
If you programmatically use dotlottie player with such animation, it stops on that false last frame.

I believe this is related to #281

@ishuvalov
Copy link
Author

UPD: You can see the empty last frame effect in this sandbox
https://codesandbox.io/p/sandbox/elegant-dawn-forked-qdlwkf?file=%2Fsrc%2FApp.js%3A1%2C1

@Hamdysaad20
Copy link

@ishuvalov you need to add loop attribute to it as following:

const App = () => {
  return (
    <div>
      <DotLottiePlayer
        src="https://assets-v2.lottiefiles.com/a/3a76f9ac-731d-11ee-9d1c-afe05e840fee/c9TxQnho2e.lottie"
        autoplay
        loop
        speed={0.5}
      >
        <Controls />
      </DotLottiePlayer>
    </div>
  );
};

@ishuvalov
Copy link
Author

@Hamdysaad20 Thanks for the advice! You're right. If the loop setting is on there is no problem with empty frame. But I need just a single time play not loop, and still it ends with the empty frame because player finishes on non-existing frame - the one just after the actual last frame in animation.

@timo-bes
Copy link

We are experiencing the same issue. Will there be an update for this issue?

@afsalz afsalz self-assigned this Mar 21, 2024
@afsalz afsalz added the bug Something isn't working label Mar 21, 2024
@afsalz afsalz linked a pull request Mar 21, 2024 that will close this issue
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants