Jump to content
Search Community

Syncing a timeline with a video

friendlygiraffe
Moderator Tag

Go to solution Solved by Diaco,

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

friendlygiraffe
Posted

Hi,

 

I'm trying to sync a Timeline with a video, but the only reliable solution seems to be ontimeupdate, which only fires every half second or so

 

Is there decent solution to this?

 

Thanks

See the Pen ONNOgE by friendlygiraffe (@friendlygiraffe) on CodePen.

  • Solution
Posted

Hi friendlygiraffe  :)

 

you can use TweenLite.ticker to sync tween progress with video currentTime on every tick .

 

something like this :

var vid = document.getElementById("myVideo");
var tween = TweenMax.to( obj , 2 , { ... , ease:Linear.easeNone , paused:true });

function Update(){
  tween.progress( vid.currentTime/vid.duration )
};

vid.onplay = function() {
    TweenLite.ticker.addEventListener('tick',Update);
};
vid.onpause = function() {
    TweenLite.ticker.removeEventListener('tick',Update);
};

 

pls check this out : 

See the Pen JXXOQy by MAW (@MAW) on CodePen.

  • Like 4
Posted

this's another simple demo ( Draggable demo ) i think can help : 

See the Pen JXXMaB by MAW (@MAW) on CodePen.

  • Like 4
  • 11 months later...
Posted

Hi I love the demo with th green wheel

Is there any way to get the demo running with avi content ?

Thanks

  • 11 months later...
Posted
On 9/3/2016 at 1:13 PM, Diaco said:

obj

is not defined?

Posted

@vinsensei obj will be whatever element/s that you are animating, in his example it is '#circle', check the pen.

  • Like 1
Posted
1 minute ago, Sahil said:

@vinsensei obj sarà qualsiasi elemento / i che stai animando, nel suo esempio è '#circle', controlla la penna.

 

ok thank you, sorry :)

  • Like 1
Posted
Quote

ok thank you, sorry :)

 

You don't have to say sorry, it happens. Feel free to post any questions.

  • Like 2

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.
×
×
  • Create New...