Baseline 2024
Newly available
The cancelVideoFrameCallback()
method of the HTMLVideoElement
interface cancels a previously-registered video frame callback.
cancelVideoFrameCallback(id)
Parameters
id
A number representing the ID of the video frame callback you want to cancel. This will be the value returned by the corresponding HTMLVideoElement.requestVideoFrameCallback
call.
None (undefined
).
This example shows how to use cancelVideoFrameCallback()
to cancel a previously-registered video frame callback.
const updateCanvas = (now, metadata) => {
// Do something with the frame
// â¦
// Re-register the callback to run on the next frame
// It's important to update the videoCallbackId on each iteration
// so you can cancel the callback successfully
videoCallbackId = video.requestVideoFrameCallback(updateCanvas);
};
// Initial registration of the callback to run on the first frame
let videoCallbackId = video.requestVideoFrameCallback(updateCanvas);
// â¦
// Cancel video frame callback using the latest videoCallbackId
video.cancelVideoFrameCallback(videoCallbackId);
Specifications Browser compatibility See also
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4