vchoo27 Posted August 1, 2022 Share Posted August 1, 2022 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 1 Link to comment Share on other sites More sharing options...
GreenSock Posted August 2, 2022 Share Posted August 2, 2022 You mean like this?: See the Pen gOevrrJ?editors=0010 by GreenSock (@GreenSock) on CodePen 1 Link to comment Share on other sites More sharing options...
vchoo27 Posted August 2, 2022 Author Share Posted August 2, 2022 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 More sharing options...
GreenSock Posted August 2, 2022 Share Posted August 2, 2022 Sure, just add an onLeave that pauses it: See the Pen OJvQRVv?editors=0010 by GreenSock (@GreenSock) on CodePen 1 Link to comment Share on other sites More sharing options...
vchoo27 Posted August 2, 2022 Author Share Posted August 2, 2022 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 More sharing options...
GreenSock Posted August 2, 2022 Share Posted August 2, 2022 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! 1 Link to comment Share on other sites More sharing options...
vchoo27 Posted August 2, 2022 Author Share Posted August 2, 2022 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now