Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
Andy1708

Video animation with ScrollTrigger, GSAP and react

Recommended Posts

Hello,

Can you tell me if it is the best way to play the animation with Scrolltriger, gsap and react.

Is there another way to acheive this ?

 

I have attached a codepen demo.

 

Thanks in advanced

See the Pen PoZKxrd?editors=0111 by YVES_V (@YVES_V) on CodePen

Link to comment
Share on other sites

Hey Andy. Please do not create multiple threads for the same question. We will make sure that every post gets answered when we're able to answer them - reposting threads doesn't help :) 

 

The pen that you link to throws an error:

Quote

Uncaught TypeError: Failed to set the 'currentTime' property on 'HTMLMediaElement': The provided double value is non-finite.
    at pen.js:30

It'd be helpful if you changed the demo to make it reproduce the situation that you have.

 

Regardless, using a setTimeout and requestAnimationFrame is very likely a bad way to go about doing what you're trying to do. Why not set the video's current time inside of the ScrollTrigger's onUpdate? It'd perform better and likely be less buggy.

Link to comment
Share on other sites

6 hours ago, ZachSaucier said:

 

Sorry Zack,

i thought i was lost in the flow…

 

i try to set the video's current time inside the scrollTrigger but it doesn't work !

 

any idea ?

Thanks

Andy

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.
×