--- title: VRDisplay.requestAnimationFrame() slug: Web/API/VRDisplay/requestAnimationFrame translation_of: Web/API/VRDisplay/requestAnimationFrame ---
The requestAnimationFrame()
method of the {{domxref("VRDisplay")}} interface is a special implementation of {{domxref("Window.requestAnimationFrame")}} containing a callback function that will be called every time a new frame of the VRDisplay
presentation is rendered:
VRDisplay
is not presenting a scene, this is functionally equivalent to {{domxref("Window.requestAnimationFrame")}}.VRDisplay
.var handle = vrDisplayInstance.requestAnimationFrame(callback);
VRDisplay
presentation is rendered.A long representing the handle of the requestAnimationFrame()
call. This can then be passed to a {{domxref("VRDisplay.cancelAnimationFrame()")}} call to unregister the callback.
TBD.
Specification | Status | Comment |
---|---|---|
{{SpecName('WebVR', '#dom-vrdisplay-requestanimationframe', 'requestAnimationFrame()')}} | {{Spec2('WebVR')}} | Initial definition |
{{CompatibilityTable}}
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
---|---|---|---|---|---|
Basic support | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} | {{CompatNo}} | {{CompatNo}} | {{CompatNo}} |
Feature | Android | Firefox Mobile (Gecko) | IE Phone | Opera Mobile | Safari Mobile | Chrome for Android |
---|---|---|---|---|---|---|
Basic support | {{CompatNo}} | {{CompatVersionUnknown}} | {{CompatNo}} | {{CompatNo}} | {{CompatNo}} | {{CompatNo}} |