dkaoster / scrolly-video

Components for scroll-based (or other externally controlled) playback.
https://scrollyvideo.js.org/
MIT License
965 stars 39 forks source link

feat(setScrollPercent): align trackScroll with videoPercentage #91

Closed tarsisexistence closed 6 months ago

tarsisexistence commented 6 months ago

This PR addresses this issue https://github.com/dkaoster/scrolly-video/issues/89.

By design, I add a new callback that replaces setTargetTimePercent because it manipulates with currentTime which doesn't have a sync with a scroll position (described in issue #89).

So, here we

tarsisexistence commented 6 months ago

@dkaoster, I wonder whether we should adjust anything else here?

And I should probably add the support for callbacks of other implementations (like Svelte)

tarsisexistence commented 6 months ago

@dkaoster I decided to support videoPercentage on instance as well. So if videoPercentage is changed with enabled trackScroll - we prefer setPercentage instead of setTargetTimePercent

I did the same for Svelte and Vue. I need help to validate them. I would appreciate your review.