| Summary: | Unable to reliably grab video frame from Blob immediately after loading | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Teodor <teodor.atroshenko> |
| Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | cdumez, eric.carlson, jer.noble, webkit-bug-importer, youennf |
| Priority: | P2 | Keywords: | InRadar |
| Version: | Safari 15 | ||
| Hardware: | iPhone / iPad | ||
| OS: | iOS 15 | ||
|
Description
Teodor
2022-02-14 12:41:02 PST
The most reliable way of achieving your goal is to use the new requestVideoFrameCallback() API. Installing this callback before loading the video will result in your callback being called once a video frame is available. This guarantees you can paint as early as possible, without having to wait for a particular event to fire. Please take a look at <https://jernoble.github.io/samples/bin/video-to-canvas/blob.html>. The rVFC() technique can be used at startup & seeking, doesn't require specific events, will be triggered immediately when the frame becomes available (which may occur before the triggering event fires), and provides metadata about the available frame. Thank you for the link. I was not aware of this new API. I have no way of testing it just yet on 15.4, but I will report back when I have. If it works, it will be the right solution for this issue. I'm closing the issue as resolved for now. The proposed solution is confirmed to be working. |