Jump to content

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

Callback when GSAP clock changes

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts


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.

Link to comment
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.

Link to comment
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. 

Link to comment
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
Link to comment
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
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.