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
OTVInsightAgentclass.Declaration
Swift
@objc public init(xConfig: OTVInsightConfig)Parameters
xConfigThe Insight Config details
-
Starts a session without user information. User Information can be set using API
setUserInfoDeclaration
Swift
@objc public func startSession(xPlayer: OTVAVPlayer, xContentInfoHolder: ContentInfoHolder)Parameters
xPlayerThe player Instance
xContentInfoHolderThe Content Info Holder
-
Starts a session with user information.
Declaration
Swift
@objc public func startSession(xPlayer: OTVAVPlayer, xContentInfoHolder: ContentInfoHolder, xUserInfoHolder: UserInfoHolder?)Parameters
xPlayerThe player Instance
xContentInfoHolderThe Content Info Holder
xUserInfoHolderThe 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
xOffsetLiveThe 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
xAudioLanguageThe audio language
-
Sets the Subtitle Language (may change during the course of a session)
Declaration
Swift
@objc public func setSubtitleLanguage(xSubtitleLanguage: String)Parameters
xSubtitleLanguageThe subtitle language
-
Sets the user info
Declaration
Swift
@objc public func setUserInfo(xUserInfoHolder: UserInfoHolder)Parameters
xUserInfoHolderThe user Info Holder
-
Sets the named event.
Declaration
Swift
@objc public func addNamedEvent(xName: String, xDescription: String)Parameters
xNameThe name of the event
xDescriptionThe description of the event
-
addNetworkEvent(statusCode:originatingUrl: httpHeaders: requestType: mediaType: loadStartedTimestamp: loadCompletedTimestamp: ) 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
statusCodehttp status code
originatingUrlthe URL related to the event
httpHeadersthe http headers present in the http response
requestTypetype of the http request (licence, manifest, segment, time, …)
mediaTypetype of media (video, audio, subtitles, …)
loadStartedTimestampnetwork request start time in ms, that is the time from 1st Jan 1970
loadCompletedTimestampnetwork 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
codeCode of the error
messageError message
-
Notifies the agent of a playback error
Declaration
Swift
@objc public func addErrorEvent(code: String, message: String, type: ErrorType)Parameters
codeCode of the error
messageError message
typeIs the error critical or recoverable?
OTVInsightAgent Class Reference