requestVideoFrameCallback()Baseline · Newly available
The requestVideoFrameCallback() method for <video> schedules a function that runs with the next video frame. It is similar to requestAnimationFrame(), but for video.
Works in the latest version of every major browser, but older devices may not support it yet. Baseline since Oct 29, 2024.
Browser support
DesktopChrome
1–81Not supported
83+Supportedsince May 19, 2020
Current: 155Edge
12–81Not supported
83+Supportedsince May 21, 2020
Current: 154Firefox
1–131Not supported
132+Supportedsince Oct 29, 2024
Current: 157Safari
1–15.3Not supported
15.4+Supportedsince Mar 14, 2022
Current: 27MobileChrome Android
18–81Not supported
83+Supportedsince May 19, 2020
Current: 155Firefox Android
4–131Not supported
132+Supportedsince Oct 29, 2024
Current: 157Safari iOS
1–15.3Not supported
15.4+Supportedsince Mar 14, 2022
Current: 27How to use
Every current browser supports this, but it only became Baseline on Oct 29, 2024. Use it as a progressive enhancement, or keep a fallback if you support older devices.
Example
Full syntax and examples are on MDN: cancelVideoFrameCallback.
Feature detection
JS · check before using
if ("HTMLVideoElement" in globalThis && "requestVideoFrameCallback" in HTMLVideoElement.prototype) {
// HTMLVideoElement.requestVideoFrameCallback is available
}Documentation (MDN)
Specification
Sub-features
Support for each part of the feature (2). The overall table above shows when the whole feature works.
| Sub-feature | Chrome | Edge | Firefox | Safari | Chrome Android | Firefox Android | Safari iOS |
|---|---|---|---|---|---|---|---|
| HTMLVideoElement.cancelVideoFrameCallback | 83 | 83 | 132 | 15.4 | 83 | 132 | 15.4 |
| HTMLVideoElement.requestVideoFrameCallback | 83 | 83 | 132 | 15.4 | 83 | 132 | 15.4 |