Freigeben über


requestPresent method

The requestPresent method begins presenting the contents of the specified VRLayers on the VRDisplay.

Syntax

var retval = VRDisplay.requestPresent(layers);

Parameters

  • layers
    Type: VRLayer

    A sequence of VRLayers that represent the scene to present.

Return value

Type: promise<void>

Resolves once the presentation has begun.

Remarks

If canPresent is false, if the array contains more than maxLayers, or if requestPresent is called outside of a user gesture the promise will be rejected.

If the VRDisplay is already presenting when requestPresent is called, the VRDisplay will update the VRLayer array being presented. If a call to requestPresent is rejected while the VRDisplay is already presenting, the VRDisplay will end its presentation.

See also

VRDisplay