Constructor
new VRManager(containernon-null, canvasnullable, videonon-null, playernon-null, config, controlsnon-null)
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
container |
HTMLElement | ||
canvas |
HTMLCanvasElement |
<nullable> |
|
video |
HTMLMediaElement | ||
player |
shaka.Player | ||
config |
shaka.extern.UIConfiguration | ||
controls |
shaka.ui.Controls |
- Implements:
- Source:
Members
PINCH_ZOOM_FACTOR_ :number
Amount of field of view change per pixel of pinch distance change.
The value is scaled down by 50 in shaka.ui.VRWebgl.zoom, so this results
in 0.1 degrees of field of view per pixel.
Type:
- number
- Source:
Methods
canPlayVR() → {boolean}
Returns if a VR is capable.
- Source:
Returns:
- Type
- boolean
canStartGesture_(targetnullable) → {boolean}
Returns true if a VR gesture can start on this element. Gestures that
start on the controls (buttons, menus, seek bar) should not move the
view.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
target |
EventTarget |
<nullable> |
- Source:
Returns:
- Type
- boolean
checkVrStatus_()
- Source:
configure(confignon-null)
Parameters:
| Name | Type | Description |
|---|---|---|
config |
shaka.extern.UIConfiguration |
- Source:
gestureMove_(x, y)
Parameters:
| Name | Type | Description |
|---|---|---|
x |
number | |
y |
number |
- Source:
gestureStart_(x, y)
Parameters:
| Name | Type | Description |
|---|---|---|
x |
number | |
y |
number |
- Source:
getFieldOfView() → {number}
Returns the field of view.
- Source:
Returns:
- Type
- number
getGL_(canvasnullable) → {WebGLRenderingContext}
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
canvas |
HTMLCanvasElement |
<nullable> |
- Source:
Returns:
- Type
- WebGLRenderingContext
getNorth() → {number}
Get the angle of the north.
- Source:
Returns:
- Type
- number
getPinchDistance_(eventnon-null) → {number}
Parameters:
| Name | Type | Description |
|---|---|---|
event |
TouchEvent |
- Source:
Returns:
- Type
- number
incrementPitch(angle)
Increment the pitch in X angle in degrees.
Parameters:
| Name | Type | Description |
|---|---|---|
angle |
number |
- Source:
incrementRoll(angle)
Increment the roll in X angle in degrees.
Parameters:
| Name | Type | Description |
|---|---|---|
angle |
number |
- Source:
incrementYaw(angle)
Increment the yaw in X angle in degrees.
Parameters:
| Name | Type | Description |
|---|---|---|
angle |
number |
- Source:
init_(projectionMode, hfov)
Parameters:
| Name | Type | Description |
|---|---|---|
projectionMode |
string | |
hfov |
number |
- Source:
isPlayingVR() → {boolean}
Returns if a VR is supported.
- Source:
Returns:
- Type
- boolean
isStereoscopicModeEnabled() → {boolean}
Returns true if stereoscopic mode is enabled.
- Source:
Returns:
- Type
- boolean
release()
Request that this object release all internal references.
- Implements:
- Source:
setFieldOfView(fieldOfView)
Set the field of view.
Parameters:
| Name | Type | Description |
|---|---|---|
fieldOfView |
number |
- Source:
setupDeviceOrientationListener_()
- Source:
setupVRListeners_()
- Source: