Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
Kishin Karra

Callback when GSAP clock changes

Recommended Posts

Hi, 

Newbie here.

I know that when the app performance goes low, gsap automatically slows down the internal gsap clock and brings back to normal when the performance is back to normal.

 

I just want to know is there a direct way to find out wether the clock has changed or not?

 

One way is i can animate a dummy element from my timeline start to timeline end and check the time in onupdate.

But is there some direct callback/event which i can use?

 

Sorry if the question is absurd or doesnt make sense at all.

Share this post


Link to post
Share on other sites

So we have a system where certain animations on elements run and simultaneously audio plays (combine them and you get a video), so to keep them in sync I need to constantly know that wether my audio is leading or lagging so that i can adjust it accordingly.

Share this post


Link to post
Share on other sites

Using lag smoothing, i can tell Timeline/Tweens to adjust the lag (when the time between ticks is higher than x make them act as y milliseconds) but how do i know when the lag is actually smoothed. Thats when i will also smooth the lag of my audio. 

Share this post


Link to post
Share on other sites

I'm a bit confused about the "why" behind all this - if your goal is to synchronize your audio with a particular timeline, wouldn't it be much easier to just use an onUpdate on that timeline and check the time(), compared to your audio's time and if it drifts beyond a certain threshold, make your adjustment to the audio? 

  • Like 3

Share this post


Link to post
Share on other sites

You are absolutely correct. That is what i mentioned in the initial question as well, I was just trying to figure out if there is a more efficient solution which i could not figure out from the docs. 

 

Will go with onUpdate then, 

 

Thanks a lot 😀

  • Like 2

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.

×