-
Notifications
You must be signed in to change notification settings - Fork 56
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
HTMLVideoElement.requestVideoFrameCallback() #429
Comments
I think one thing that's worth considering here is whether modeling this after |
Yes. When reviewing the TAG API Design Principle, I noticed that promises are preferred, but there was some talk of generalizing the AnimationFrameProvider interface mixin, which uses callbacks. |
I wonder whether something based on Streams would make sense here. (And to be extra clear, when I say "I wonder", I really mean that I'm not sure.) |
My take is that the requestAnimationFrame design has mostly stood the test of time, apart from the overlong name. (And on that point, consistency/familiarity is more valuable than creating a new shorter name for new APIs that share the same semantics.) In particular, here are a comparison with other paradigms:
I'd be interested to hear others' perspectives on an |
I tend to agree with @domenic here that consistency really matters here, and a callback seems fine as this will be called for every frame |
Thank you for your comments! Are there any questions that need further elaboration? As per Domenic's comment, does anyone have any other perspectives on the event based model? |
My feedback from webkit-dev (https://lists.webkit.org/pipermail/webkit-dev/2020-January/031030.html):
|
Here is the draft specification. It incorporates @smfr's feedback. Notably, the callbacks now fire as part of the rendering steps, immediately before window.requestAnimationFrame() callbacks. We experimented with using microtask timing instead of animation-frame timing. Painting from a microtask was significantly less smooth for 60fps video on a 60hz screen, due to some vsyncs having double (wasted) paints, and some having none. As such, I don't think a promise or an event with microtask timing makes much sense. Animation-frame timing is the best option for the intended purpose of this API. requestAnimationFrame() could still be an event or a differently named method. However, on that front, I also tend to agree with @domenic on the consistency of the naming being favorable. |
@kenchris and I discussed this during our VF2F. As for the design itself, we are pretty happy to see this move forward. As for the naming; we don't have strong opinions on what it should be called as long as it is descriptive of what it does and is consistent enough with the rest of the platform. Thanks for bringing this to our attention, and let us know if you have any significant design changes that warrant a second review. |
Thank you! |
Hello TAG!
I'm requesting a TAG review of:
Further details:
We recommend the explainer to be in Markdown. On top of the usual information expected in the explainer, it is strongly recommended to add:
The WICG Proposal has some public comments.
You should also know that:
This proposal is still in the early stages.
We'd prefer the TAG provide feedback as (please select one):
The text was updated successfully, but these errors were encountered: