OTVInsightAgent
public class OTVInsightAgent : NSObject
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.
-
Constructor for
OTVInsightAgent
class.@param xConfig The Insight Config details
Declaration
Swift
@objc public init(xConfig: OTVInsightConfig)
-
Starts a session without user information. User Information can be set using API
setUserInfo
@param xPlayer The player Instance @param xContentInfoHolder The Content Info Holder
Declaration
Swift
@objc public func startSession(xPlayer: OTVAVPlayer, xContentInfoHolder: ContentInfoHolder)
-
Starts a session with user information.
@param xPlayer The player Instance @param xContentInfoHolder The Content Info Holder @param xUserInfoHolder The User Info Holder
Declaration
Swift
@objc public func startSession(xPlayer: OTVAVPlayer, xContentInfoHolder: ContentInfoHolder, xUserInfoHolder: UserInfoHolder?)
-
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
@param xOffsetLive The offset from live point
Declaration
Swift
@objc public func setOffsetFromLive(xOffsetLive: Int)
-
Sets the Audio Language (may change during the course of a session)
@param xAudioLanguage The audio language
Declaration
Swift
@objc public func setAudioLanguage(xAudioLanguage: String)
-
Sets the Subtitle Language (may change during the course of a session)
@param xSubtitleLanguage The subtitle language
Declaration
Swift
@objc public func setSubtitleLanguage(xSubtitleLanguage: String)
-
Sets the user info @param xUserInfoHolder The user Info Holder
Declaration
Swift
@objc public func setUserInfo(xUserInfoHolder: UserInfoHolder)
-
Sets the named event.
@param xName The name of the event @param xDescription The description of the event
Declaration
Swift
@objc public func addNamedEvent(xName: String, xDescription: String)
-
addNetworkEvent(statusCode:
originatingUrl: httpHeaders: requestType: mediaType: loadStartedTimestamp: loadCompletedTimestamp: ) Notifies the agent of a network event Notifies the agent of a network event
@param statusCode: http status code @param originatingUrl: the URL related to the event @param httpHeaders: the http headers present in the http response @param requestType: type of the http request (licence, manifest, segment, time, …) @param mediaType: type of media (video, audio, subtitles, …) @param loadStartedTimestamp: network request start time in ms, that is the time from 1st Jan 1970 @param loadCompletedTimestamp:network request completed time in ms, that is the time from 1st Jan 1970
Declaration
Swift
@objc public func addNetworkEvent(statusCode: Int, originatingUrl: String?, httpHeaders: [String : String]?, requestType: RequestType, mediaType: MediaType, loadStartedTimestamp: TimeInterval, loadCompletedTimestamp: TimeInterval)
-
Notifies the agent of a playback error
@param code: Code of the error @param message: Error message
Declaration
Swift
@objc public func addErrorEvent(code: Int, message: String)
-
Notifies the agent of a playback error
@param code: Code of the error @param message: Error message @param type: Is the error criticial or revocerable?
Declaration
Swift
@objc public func addErrorEvent(code: String, message: String, type: ErrorType)