--- title: VRDisplay.requestAnimationFrame() slug: Web/API/VRDisplay/requestAnimationFrame translation_of: Web/API/VRDisplay/requestAnimationFrame ---
{{APIRef("WebVR API")}}{{SeeCompatTable}}

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:

Syntax

var handle = vrDisplayInstance.requestAnimationFrame(callback);

Parameters

callback
A callback function that will be called every time a new frame of the VRDisplay presentation is rendered.

Return value

A long representing the handle of the requestAnimationFrame() call. This can then be passed to a {{domxref("VRDisplay.cancelAnimationFrame()")}} call to unregister the callback.

Examples

TBD.

Specifications

Specification Status Comment
{{SpecName('WebVR', '#dom-vrdisplay-requestanimationframe', 'requestAnimationFrame()')}} {{Spec2('WebVR')}} Initial definition

Browser compatibility

{{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}}

See also