-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: custom easing #88
Conversation
I made a few controversial changes I'm open to discuss:
|
hey @dkaoster , just for my expectations, i'm curious when would you have time to review this PR? |
@tarsinzer Sorry! Will take a look in the next couple of days! |
# Conflicts: # src/ScrollyVideo.js
@tarsinzer Had some time to look at this today. I think what's going to be a little unfortunate is that this solution will only be compatible with the webcodecs approach to rendering, meaning that it will currently only be supported in chrome. Given that many people using this library are already confused by the implementations in different browsers, I'm hesitant to introduce another feature that only works in Chromium based browsers. Additionally, I tried a few different easing functions and it seems most of them are not very well suited for this implementation, maybe there is a better way of doing this.. Thoughts? |
@dkaoster Regarding browser support, I can't say much, honestly... And regarding easing functions, can you say what exactly you used? I used several ones, and all worked as expected. Do you think that the problem is on implementation side? 🤔 |
For example, if I try using this code on your branch,
it kind of rolls forward a few frames and then jumps? Screen.Recording.2024-02-17.at.10.11.21.PM.mov |
Regarding browser compatibility, my instinct is to wait on webcodecs support in all the major browsers: Chrome, Safari, and Firefox, and then we'll be able to simplify the implementation of this library a lot, and it would make more sense to implement this feature then. I'm open to hearing other thoughts if you feel like this feature should be included sooner, though! |
@dkaoster, the issue on your preview is not related to the easing. I won't dive more deeply here, but it's something at the beginning when the video is uploading/decoding. It's visually noticeable (different colours and brightness of the frame). If you click too fast on the beginning, your animation will be broken. Here's a preview of |
No, what's broken seems to be the trackscroll feature. See this video of clicking on the seeker bar vs scrolling. If I set it to easeLinear or simply removing the easing it works fine. Screen.Recording.2024-02-18.at.9.21.32.AM.mov |
@dkaoster do you apply easing for the ScrollyVideo instance or via set percentage function? In my testing setup, I use a function instead of an instance. Actually, it's quite a bad idea to use easing for trackscroll feature. scrollyRef.current.setVideoPercentage(
parseFloat(e.target.value),
{
easing: d3.easeLinear,
}
) |
Today I was thinking about browser support. There are two potential ways:
|
@tarsinzer okay, I see what you're saying. I agree with you, it's not a good idea to have easing on the track scroll feature, so I'm going to suggest that we remove the ability to add easing to the scrollyVideo instance completely and have it only available as an argument to the Regarding browser support, I wonder if we should release this under a name called |
@dkaoster sounds like a plan! I'll do it soon. Thanks for collaborating on that idea! |
@dkaoster wdyt about the last commit? Couldn't understand how to test it properly, because it just literally jumps on backwards in Firefox. |
@tarsinzer this looks good to me! I think you can go ahead and remove your demo and we should be good to merge. |
@tarsinzer one more thing, do you mind updating this line in the readme with the new arguments? |
@dkaoster absolutely! I just updated it. Please validate. |
@tarsinzer I see, I can help you add it into svelte and vue after this. |
Solves my request: #84 (comment)
Issue: #87
The first commit is an actual feat.
The second commit is an example to play on it. It would be deleted for sure.