Jump to content
GreenSock

anotheruser

Control Video HTML Tag

Recommended Posts

Hi

 

Is it possible to control a html video tag's playback using GSAP

 

Right now what am doing is using GSAP's callback function to start two/three videos 

 

But is it possible to pause the video when the timeline is paused as well

Link to comment
Share on other sites

?Just like this

 

See the Pen VPVoVa by sheriffderek (@sheriffderek) on CodePen

 

Here the tween stopped when the audio is paused

 

But what i need is the audio to be stopped when the tween is paused

Link to comment
Share on other sites

Hey anotheruser,

 

There must be some function telling the tween to pause, correct? So pause the video there as well. 

 

Often times for situations like these I'll write a function to not have to duplicate the tween.pause() and video.pause() every time I need to do it:

function pauseVideo() {
  tween.pause();
  video.pause();
}

// now you can just pauseVideo() when you need to

Same thing for playing them.

  • Like 3
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.
×