Ultralight icon indicating copy to clipboard operation
Ultralight copied to clipboard

Control over the internal render time / timer.

Open nikolain opened this issue 3 years ago • 3 comments

External control over the internal render timer to allow rendering HTML/CSS animations synchronized with external source.

Specific use case: render HTML/CSS as overlays for the video frames. Since video frames might arrive come in slower or faster then real time (but always have a proper timestamp) it would be nice to be able to precisely control when internal CSS animations timer(s) actually advance to keep HTML/CSS rendering synchronized to the video.

nikolain avatar May 05 '21 18:05 nikolain

AFAIK WebCore uses a global currentTime() function to query the current clock (used for both CSS and JavaScript animations)-- https://github.com/ultralight-ux/WebCore/blob/master/Source/WTF/wtf/CurrentTime.cpp#L156

We could allow the user to override the current clock so they can control when it advances-- this may, however, impact some unrelated timers/timeouts throughout the codebase (I'm thinking of network/cache timeouts). Won't know for sure until we try it out :).

adamjs avatar May 07 '21 07:05 adamjs

I think I might accept "unrelated timers/timeouts throughout the codebase" as an acceptable risk, since I envision a rather controlled use case. It would be awesome to officially allow overwriting this function in the config, as it would avoid the need to hook/trampoline the Windows API calls.

If you need any help / encouragement / support, let me know :). I'm local to SF area as well.

nikolain avatar May 18 '21 02:05 nikolain

👍 from me to, I also would love an official way to control the time. It would allow to have stable CSS animations while rendering out a video in "not real time".

mario-deluna avatar Aug 26 '21 11:08 mario-deluna