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

segments not working? #30

Open
ocundale opened this issue Dec 1, 2019 · 3 comments
Open

segments not working? #30

ocundale opened this issue Dec 1, 2019 · 3 comments

Comments

@ocundale
Copy link

ocundale commented Dec 1, 2019

I am having issues with the segments- for me, displaying a custom set of segments does not seem to do anything. My code:

import React from 'react';
import animation from './animation.json';
import Lottie from 'lottie-react-web';

const Opening = () => {
  const options = {
    loop: true,
    autoplay: true,
    prerender: true,
    animationData: animation,
  };

  return (
    <React.Fragment>
      <Lottie options={options} segments={[0, 8]} />
    </React.Fragment>
  );
};

export default Opening;
@Kegulf
Copy link

Kegulf commented Feb 14, 2020

I'm having the same issue.

Been looking into it and it might be implemented wrong in lottie-react-web
Seems like the segments logic needs to be hooked onto DOMLoaded event of anim

I have not tested this, but it is mentioned in several issues from lottie-web

ex:
airbnb/lottie-web#581 (comment)

@mifi
Copy link

mifi commented Jul 12, 2020

I never got segments to work in any of the existing lottie-web React wrappers, so I created a new, easier to use lottie React wrapper: react-lottie-player

@coding-ice
Copy link

Has this problem been solved

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

4 participants