Repository navigation
Update web/api/htmlvideoelement/requestvideoframecallback/index.md - #46314
vasilich-tregub wants to merge 4 commits into
Conversation
This edit corrects page's example application which unfortunately produces a garbled output for fps. To compute fps, the edited app uses a metadata.presentedFrames field data instead of local var paintCount used by original code and incremented manually in each callback function call. The fps calculation is restricted to the first-time playback; video controls are disabled for this run to simplify the logic of calculation. Metadata are presented as in original app.
|
Lint failed with 'Fail if any issues pending'; I posted an issue #46316 |
|
Please see the log output. This has nothing to do with the lack of a linked issue. (And in general, if you already submitted a PR, there's no need for an issue.)
|
Video source can be re-connected: two video sources can be selected, and fps data array is recalculated
Selectable video source options added. Instead of direct fps calculation, intercomparison of 'now' and 'metadata.mediaTime' values for video frames played is emphasized.
This edit corrects page's example application which unfortunately produces a garbled output for fps. To compute fps, the edited app uses a metadata.presentedFrames field data instead of local var paintCount used by original code and incremented manually in each callback function call. The fps calculation is restricted to the first-time playback; video controls are disabled for this run to simplify the logic of calculation. Metadata are presented as in original app.
Description
This edit corrects page's example application which unfortunately produces a garbled output for fps. To compute fps, the edited app uses a metadata.presentedFrames field data instead of local var paintCount used by original code and incremented manually in each callback function call. The fps calculation is restricted to the first-time playback; video controls are disabled for this run to simplify the logic of calculation. Metadata are presented as in original app.
Motivation
The original example on this page fails to compute frame-per-sec value for a video clip viewed. The calculation on the page produces a garbled output. This bug is trivially corrected with the help of metadata info, but the code becomes complicated if the purpose is to compute fps on the fly while accommodating every user action as pause-seek-replay. So, I restricted the fps calculation to an undisturbed first-time playback that runs from the beginning to the end of the media. To present the most of information, I log the calculation results to the page for every frame of the media which admittingly helps user understand the procedure more clearly. The metadata printout, as in the original application, accompanies this first-time and further playback runs to help the user study how user action reveal itself in the metadata content.
Additional details
Related issues and pull requests