popmotion icon indicating copy to clipboard operation
popmotion copied to clipboard

Pause and rewind capability

Open mediabuff opened this issue 1 year ago • 7 comments

It will be useful to add pause and rewind operations. Right now the only method available is ‘play’. I Sn trying to use the lib for song lyrics animation

mediabuff avatar Apr 06 '23 03:04 mediabuff

You may want to look at using Motion One that has playbackRate. It's the latest animation library from the same author.

If for some reason you want to stick with popmotion you might be able to add pause/rewind through a custom Driver.

stokesman avatar Apr 11 '23 00:04 stokesman

Thanks for the pointers. Is Motion One open source ? I liked popmotion because it's Typescript based. I only see Javascript files in Motion One github. Are those transpiled files ?

mediabuff avatar Apr 11 '23 11:04 mediabuff

Also, on playbackRate. - Looking for similar but not same capability. I am look for 'seek' to a specific point in timeline (from start). For song lyicrs animation, when the music is 'seeked', the lyrices animation has to be seeked as well. Or how I achieve this with 'playrate'

mediabuff avatar Apr 11 '23 11:04 mediabuff

Also, on a custom Driver., it seems to provide for 'delta'time. How to go back in absolute time ?

mediabuff avatar Apr 11 '23 11:04 mediabuff

Motion One is fully in Typescript, not sure where you’d find JS files. But it wouldn’t be able to support driver as it’s based on WAAPI

mattgperry avatar Apr 11 '23 11:04 mattgperry

@mattgperry thanks for the clarification. Could you please address my other questions - as you are the most qualified to answer them

  1. is Motion One open source ?
  2. in Popmotion, as @stokesman was pointing out, please provide some guidance on how I could use driver to 'seek'
  3. or in Motion One, using playbackRate, how would I do the same

mediabuff avatar Apr 11 '23 15:04 mediabuff

I am look for 'seek' to a specific point in timeline (from start).

Okay, in that case you might want to try animejs as it does have a built in seek. It's open source and while not TS, types are available.

I thought more about how to pull off the same with Popmotion and it'd probably be not through driver but instead the Iterators. You'd have to implement a timeline and animation loop yourself. Having said that, I recall version 8 of Popmotion has timeline and supports seek. So that's another option.

stokesman avatar Apr 12 '23 01:04 stokesman