This is an experimental technologyCheck 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
XRFrame
representing a snapshot of the state of all of the tracked objects for theXRSession
.
Return Value
None.
Specifications
Specification | Status | Comment |
---|---|---|
WebXR Device APIThe definition of 'XRFrameRequestCallback' in that specification. | Working Draft | Initial definition. |
Browser compatibility
Update compatibility data on GitHub
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
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.
XRFrameRequestCallback by Mozilla Contributors is licensed under CC-BY-SA 2.5.