# Animation ignores playSegments endframe

**URL:** https://forum.lottiefiles.com/t/animation-ignores-playsegments-endframe/1163
**Category:** Lottie in Web
**Created:** [July 1, 2021, 7:35pm UTC](https://forum.lottiefiles.com/t/animation-ignores-playsegments-endframe/1163 "2021-07-01T19:35:20Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![spam](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.lottiefiles.com/spam/32/224_2.png) [@spam](https://forum.lottiefiles.com/u/spam)
#### Post date: [July 1, 2021, 7:35pm UTC](https://forum.lottiefiles.com/t/animation-ignores-playsegments-endframe/1163/1 "2021-07-01T19:35:20Z")

</div>

Hi everbody,

So i created a [Website](https://kulturtragflaechen.de/) with some Lottie animations and for the most parts it works perfectly. But I have a problem with the playSegment command which is triggered onload for the Main Hero Animation and the hamburger menu.

Sometimes (!) if I load the site the animation starts but doesn’t stop at the endframe.

Here I load the animation:

```auto
heroMain = document.getElementById('bodymovin');

let animHero = bodymovin.loadAnimation({
  container: heroMain,
  renderer: 'svg',
  loop: false,
  autoplay: true,
  path: "https://assets3.lottiefiles.com/packages/lf20_1puayea0.json",
  rendererSettings: {
    progressiveLoad: false,
    preserveAspectRatio: 'xMidYMid slice'
  }
});

```

and here i execute it:

```auto
$(document).ready(function () {
animHero.playSegments([30, 300], true);
};

```

This occures also for the hamburger navigation, when you scroll down and reload the website.  
I’m super confused since I don’t get an errormessage nor does it happen every time…

Do you have an Idea, whats happening here?

Best regards

Phil

PS: I LOVE LOTTIE \<3

---

<div class="post-metadata">

### Author: ![spam](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.lottiefiles.com/spam/32/224_2.png) [@spam](https://forum.lottiefiles.com/u/spam)
#### Post date: [July 3, 2021, 12:20am UTC](https://forum.lottiefiles.com/t/animation-ignores-playsegments-endframe/1163/2 "2021-07-03T00:20:10Z")

</div>

Found a solution here: [playSegments() · Issue #398 · airbnb/lottie-web · GitHub](https://github.com/airbnb/lottie-web/issues/398)
