Jump to content
GreenSock

vchoo27

Webm video play only once until page refresh

Recommended Posts

Hi I'm wondering if there's a way to trigger a webm video to play through the entire video only once onEnter, no pause/reverse on other onLeave, onEnterBack, onLeaveBack events but the video always replays/resumes when scrolling back into the trigger from the top down.

 

Thank you for the help!

See the Pen dymdYvP by vchoo (@vchoo) on CodePen

  • Like 1
Link to comment
Share on other sites

Is there a way to not have the video play if the user scrolls back above the video trigger start and back down again? Do I need to just add another "ScrollTrigger.create" for "onEnterBack" same as your example for "onLeaveBack" above? Thank you!

Link to comment
Share on other sites

Can the video be paused if 'onEnter' is triggered a second time? I do want the video to keep playing onLeave

 

Basically just want the video to play once through when user scrolls to it, but it doesn't play again ever when user scrolls back to top of page and then back to where the video clip is (until page refresh)

 

Thank you so much!

Link to comment
Share on other sites

I'm so confused - that's basically what my first version did. But you said "...but the video always replays/resumes when scrolling back into the trigger from the top down". So which is it? Do you want it to replay at all or never again? 

 

I think I've given you all the tools you need. You can add whatever you want in the onEnter/onLeave/onEnterBack/onLeaveBack to control the video however you please. Play it, pause it, whatever. 

 

Good luck!

  • Like 1
Link to comment
Share on other sites

Sorry for the confusion! Basically never again, only once. I will try the pause with 'onEnterBack', thank you again for your help!

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