OTVInsightAgent

public class OTVInsightAgent : NSObject, OTVTracksChangedListener

The OTVInsightAgent class is a wrapper for Insight Agent. The class can be used to enable the reporting of playback metrics to the Insight servers.

  • Declaration

    Swift

    public func tracksChanged()
  • Constructor for OTVInsightAgent class.

    Declaration

    Swift

    @objc
    public init(xConfig: OTVInsightConfig)

    Parameters

    xConfig

    The Insight Config details

  • Starts a session without user information. User Information can be set using API setUserInfo

    Declaration

    Swift

    @objc
    public func startSession(xPlayer: OTVAVPlayer, xContentInfoHolder: ContentInfoHolder)

    Parameters

    xPlayer

    The player Instance

    xContentInfoHolder

    The Content Info Holder

  • Starts a session with user information.

    Declaration

    Swift

    @objc
    public func startSession(xPlayer: OTVAVPlayer, xContentInfoHolder: ContentInfoHolder, xUserInfoHolder: UserInfoHolder?)

    Parameters

    xPlayer

    The player Instance

    xContentInfoHolder

    The Content Info Holder

    xUserInfoHolder

    The User Info Holder

  • Stop the session (if started)

    Declaration

    Swift

    @objc
    public func stopSession()
  • Terminates the session

    Declaration

    Swift

    @objc
    public func terminate()
  • Sets the live offset of the playback, as in when Seeking on Linear TV

    Declaration

    Swift

    @objc
    public func setOffsetFromLive(xOffsetLive: Int)

    Parameters

    xOffsetLive

    The offset from live point

  • Sets the Audio Language (may change during the course of a session)

    Declaration

    Swift

    @objc
    public func setAudioLanguage(xAudioLanguage: String)

    Parameters

    xAudioLanguage

    The audio language

  • Sets the Subtitle Language (may change during the course of a session)

    Declaration

    Swift

    @objc
    public func setSubtitleLanguage(xSubtitleLanguage: String)

    Parameters

    xSubtitleLanguage

    The subtitle language

  • Sets the user info

    Declaration

    Swift

    @objc
    public func setUserInfo(xUserInfoHolder: UserInfoHolder)

    Parameters

    xUserInfoHolder

    The user Info Holder

  • Sets the named event.

    Declaration

    Swift

    @objc
    public func addNamedEvent(xName: String, xDescription: String)

    Parameters

    xName

    The name of the event

    xDescription

    The description of the event

  • Notifies the agent of a network event Notifies the agent of a network event

    Declaration

    Swift

    @objc
    public func addNetworkEvent(statusCode: Int, originatingUrl: String?, httpHeaders: [String : String]?, requestType: RequestType, mediaType: MediaType, loadStartedTimestamp: TimeInterval, loadCompletedTimestamp: TimeInterval)

    Parameters

    statusCode

    http status code

    originatingUrl

    the URL related to the event

    httpHeaders

    the http headers present in the http response

    requestType

    type of the http request (licence, manifest, segment, time, …)

    mediaType

    type of media (video, audio, subtitles, …)

    loadStartedTimestamp

    network request start time in ms, that is the time from 1st Jan 1970

    loadCompletedTimestamp

    network request completed time in ms, that is the time from 1st Jan 1970

  • Notifies the agent of a playback error

    Declaration

    Swift

    @objc
    public func addErrorEvent(code: Int, message: String)

    Parameters

    code

    Code of the error

    message

    Error message

  • Notifies the agent of a playback error

    Declaration

    Swift

    @objc
    public func addErrorEvent(code: String, message: String, type: ErrorType)

    Parameters

    code

    Code of the error

    message

    Error message

    type

    Is the error critical or recoverable?