Readonly canWhether the player can present in VR mode.
The viewing direction.
Readonly stateThe state of the VR feature.
Whether stereo mode is enabled.
 - Setting it to true renders the video in VR.
false
Whether controls using device motion on mobile devices is enabled when not viewing in stereo mode.
 - This performs actions that require user consent, so setting this to true has to be behind a button press.
 - Changes only take effect when stereo is false.
false
The vertical field of view in VR, in degress.
 - It should be a number in the range of [0, 180].
72
Add the given listener for the given event type(s).
The type of the event.
The callback which is executed when the event occurs.
Remove the given listener for the given event type(s).
The type of the event.
The callback which will be removed.
Generated using TypeDoc
The virtual reality API which allows you to control the display of 360° VR videos.
Remarks
- See VRConfiguration to configure a source.
- The player utilises the Canvas API internally to render 360° content and is restricted to the same limitations.
- To access
devicemotionevents on mobile devices, a page needs to be served over https on modern browsers.- To access
devicemotionevents on Safari for iOS 13+ you need to request user permission using the DeviceMotionEvent.requestPermission API- iPhone support requires iOS 10: On iOS 9 and lower, iPhone forces HTML5 video to play in fullscreen. As a result, the canvas used by THEOplayer VR will not be visible during playback, since it will be behind the fullscreen video. iPhone users must upgrade to iOS 10 or higher for the full VR experience. Note that iPad is unaffected: VR is supported even on iOS 9 and lower.
- Cross-origin iframes on iOS: iOS blocks cross-origin iframes from accessing
devicemotionevents WebKit bug #152299. As a result, when using THEOplayer inside a cross-origin iframe, the player cannot rotate the VR display to align with the device's physical orientation. Fortunately, this can be worked around by listening fordevicemotionevents on the top frame and forwarding them as messages to the iframe. THEOplayer will automatically handle these messages as if they were nativedevicemotionevents:Example