OTVEvent

public class OTVEvent : NSObject

An instance of a player event

  • Initailize OTVEvent instance with parameters

    Declaration

    Swift

    @objc
    public init(timestamp: Date, type: String, command: String, extra: String?)

    Parameters

    timestamp

    the timestamp of the event

    type

    the type of the event. SDK generated events will have types from EventType

    command

    the command of the event. SDK generated events will have commands from EventCommand

    extra

    optional extra information for the event. SDK generated events will have extras formatted as a JSON string, with keys from ExtraKey

    Return Value

    an event instance

  • OTVEvent instances generated by the SDK will have their type property set to one of these

    See more

    Declaration

    Swift

    public class EventType : NSObject
  • OTVEvent instances generated by the SDK will have their command property set to one of these

    See more

    Declaration

    Swift

    public class EventCommand : NSObject
  • OTVEvent instances generated by the SDK that have a non-nil extra property will have a JSON string with one or more of these keys

    See more

    Declaration

    Swift

    public class ExtraKey : NSObject
  • The time at which the event occurred

    Declaration

    Swift

    public let timestamp: Date
  • The type of the event. SDK generated events will have types from EventType

    Declaration

    Swift

    public let type: String
  • The command of the event. SDK generated events will have commands from EventCommand

    Declaration

    Swift

    public let command: String
  • Optional extra information for the event. SDK generated events will have extras formatted as a JSON string, with keys from ExtraKey

    Declaration

    Swift

    public let extra: String?
  • Returns a Dictionary representing any JSON in the extra property

    Declaration

    Swift

    public func parseExtra() -> [String : Any?]?
  • Utility function to generate a JSON string for the extra property

    Declaration

    Swift

    public static func buildExtra(_ dict: [String : Any?]) -> String?

    Parameters

    dict

    a dictionary of values for the JSON string