Skip to content
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

Add time to readNextFrame, pass it to fabricImagePostProcessing #227

Merged
merged 8 commits into from
Mar 4, 2023

Conversation

Ivanca
Copy link
Contributor

@Ivanca Ivanca commented Feb 23, 2023

Add time to readNextFrame, pass it to fabricImagePostProcessing, the reasoning is that video editors do most operation in seconds so thats what most users are used to, so the API should have a way to work with seconds

For example to add an animated circle that for the first 0.7 seconds of a video (regardless of the full length of the video) with this change we can do it like this:

fabricImagePostProcessing: ({image, time}) => {
  const step = Math.min(time / 0.7, 1) || 0.001; // animation takes 0.7 seconds
  image.setOptions({
    clipPath: new fabric.Circle({radius: 25 * animatedValue}),
  });
}

If approved make sure to squash the commits on merge.

@Ivanca Ivanca marked this pull request as ready for review February 23, 2023 21:51
Copy link
Owner

@mifi mifi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for this! i think it makes sense. only want to rename a variable

Ivanca and others added 2 commits February 26, 2023 18:50
Co-authored-by: Mikael Finstad <[email protected]>
Co-authored-by: Mikael Finstad <[email protected]>
@Ivanca
Copy link
Contributor Author

Ivanca commented Feb 26, 2023

thanks for this! i think it makes sense. only want to rename a variable

Done

@mifi mifi merged commit 5c21fed into mifi:master Mar 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants