Moritz L Posted July 13, 2023 Share Posted July 13, 2023 Hi! I am working on scrubbable video controls. I recreated the most simple version of the controls (without video and animated time) in a CodePen. I've also read this entry in the forums. But even though the problem is the same, the solution didn't seem to apply to my problem – or I am just not seeing it. The problem: My player works just fine when you click on "play", then "pause" and then drag the playhead around. When you then click "play" again, the playhead starts animating from the respective position as intended. BUT: When you hit "play" and drag the playhead without hitting "pause" first, the timeline animation doesn't work anymore. To be precise: The playhead won't animate anymore (until you rerun the code), yet the track fill will resume animating. Play around with the CodePen and you'll see what I mean. My best guess: It has something to do with the inline styles that are applied by GSAP. Because, when I am changing Draggable.type to "left", the animation is resuming also when not hitting "pause" before starting to drag. But then the dimensions seem to off and the playhead doesn't move in sync with the track anymore. And I haven't found a solution for that problem either. I really appreciate any pointing in the right direction. Thanks! See the Pen YzRewPL by moritzlaube (@moritzlaube) on CodePen Link to comment Share on other sites More sharing options...
Solution Rodrigo Posted July 13, 2023 Solution Share Posted July 13, 2023 Hi, How about something like this: See the Pen dyQdNEV by GreenSock (@GreenSock) on CodePen Hopefully this helps. Happy Tweening! Link to comment Share on other sites More sharing options...
Moritz L Posted July 14, 2023 Author Share Posted July 14, 2023 Yes, @Rodrigo, that Pen helped! Thanks. The trick was to actually kill the Tween and recreate it with an updated duration in the onDragEnd hoog of the Draggable Plugin. Cheers! 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