Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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 = () => {
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();
}
}