VR

public protocol VR : EventDispatcherProtocol

The player’s VR attributes can be used to change the stereo mode, the viewing direction and the vertical field of view. The VR attributes are properties of the vr object, which is accessible through the player object.

  • Sets or returns the viewing direction. A VR direction object with properties yaw, pitch and roll must be set to change the direction; the values of these properties should be in degrees.

    Declaration

    Swift

    var direction: VRDirection { get set }
  • Enables/disabled or returns the the stereo mode. Can be set to “true” or “false”. Setting it to true renders the video in VR; setting it to false removes the VR rendering. Default value is false.

    Declaration

    Swift

    var stereo: Bool { get set }
  • Sets or returns the vertical field of view in VR. This value can be a degree in the range of [0, 180]. Increasing this value creates a more zoomed in effect.

    Declaration

    Swift

    var verticalFOV: Int { get set }
  • Adds the given event listener of the given VREventType

    Remark

    When attaching a listener on the wrong object the application will crash.

    Declaration

    Swift

    func addEventListener<E>(type: EventType<E>, listener: @escaping (E) -> ()) -> EventListener where E : EventProtocol

    Parameters

    type

    VREventType of the added event listener

    listener

    Closure called when event is dispatched

    Return Value

    EventListener that can be removed

  • Removes the given event listener of the given VREventType

    Declaration

    Swift

    func removeEventListener<E>(type: EventType<E>, listener: EventListener) where E : EventProtocol

    Parameters

    type

    VREventType of the removed event listener

    listener

    EventListener object that has been return on addEventListener