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

recordChild should emit a timeupdate event after evaluating the timefunction #23

Open
mhaddon opened this issue Jan 14, 2023 · 4 comments
Labels
bug Something isn't working
Milestone

Comments

@mhaddon
Copy link

mhaddon commented Jan 14, 2023

Right now recordChild does not trigger a timeupdate event for the first frame of each multi render.

This means you might have single frames every x % of your video, which are just incorrect.

Currently, I have hackily fixed this by adding:

    await new Promise((accept) => setTimeout(accept, 25));
    await page.evaluate(`scene.emit("timeupdate", { currentTime: ${time} })`);
    await new Promise((accept) => setTimeout(accept, 25));

after await page.evaluate(timeFunction as any);

in the recordChild method in child.ts.

but i am sure there is a better way to implement this fix

@daybrush daybrush added the bug Something isn't working label Jan 14, 2023
@daybrush
Copy link
Owner

daybrush commented Jan 14, 2023

@mhaddon

Does the media exist in the scene?

@daybrush daybrush added this to the 0.15.0 milestone Jan 14, 2023
@daybrush
Copy link
Owner

@mhaddon

What version of Scene.js is it?

@mhaddon
Copy link
Author

mhaddon commented Jan 14, 2023

latest scenejs and latest scenejs render, it is only the first frame that each "multi" generates.

its when you try to make your own render logic using the timeupdate event, the normal css rendering is working as expected

@daybrush
Copy link
Owner

@mhaddon

Are you using "timeupdate" in your scene?

If so, how about using "animate" instead of "timeupdate"?

The animate event will fire whenever setTime is called.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants