How to use the lottie-web.play function in lottie-web

To help you get started, we’ve selected a few lottie-web examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github magna25 / lottie-editor / src / App.js View on Github external
seekByArrowKeys = (val) => {//seek using arrow keys or clicking on the track
    let currentFrame = this.state.currentFrameTime + val
    lottie.goToAndStop(currentFrame,true)
    if(!this.state.paused){
      lottie.play()
    }
  }
  playPause = () => {
github redbadger / website-honestly / site / components / pride-heart / index.js View on Github external
componentDidUpdate(prevProps: Props) {
    const { direction, play } = this.props;
    if (direction !== prevProps.direction && play === true) {
      lottie.setDirection(direction === 'forward' ? 1 : -1);
      lottie.play();
    }
    if (play !== prevProps.play && play === true) {
      lottie.play();
    }
  }