This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
The XRFrameRequestCallback is a callback function passed into XRSession.requestAnimationFrame (part of WebXR API) to obtain the current time and the current XRFrame.
Syntax
function XRFrameRequestCallback(time, XRFrame){
// Process XRFrame here
}
XRSession.requestAnimationFrame(XRFrameRequestCallback)
Parameters
DOMHighResTimeStamp- A timestamp corresponding to the returned
XRFrame.
XRFrame- An
XRFramerepresenting a snapshot of the state of all of the tracked objects for theXRSession.
Return Value
None.
Specifications
| Specification | Status | Comment |
|---|---|---|
| WebXR Device API The definition of 'XRFrameRequestCallback' in that specification. |
Working Draft | Initial definition. |
Browser compatibility
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
XRFrameRequestCallback | Chrome Full support 79 | Edge Full support 79 | Firefox No support No | IE No support No | Opera No support No | Safari No support No | WebView Android No support No | Chrome Android Full support 79 | Firefox Android No support No | Opera Android No support No | Safari iOS No support No | Samsung Internet Android Full support 11.2 |
Legend
- Full support
- Full support
- No support
- No support
- Experimental. Expect behavior to change in the future.
- Experimental. Expect behavior to change in the future.
