Package com.nagra.otvaa.sdk
Class OtvAnalyticsAgentWrapper
java.lang.Object
com.nagra.otvaa.sdk.OtvAnalyticsAgentWrapper
This class wrapping the OtvAnalyticsAgent for use by the Nagra Connect Player (OTVVideoView)
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionOtvAnalyticsAgentWrapper(Context xContext) Constructor for OtvAnalyticsAgentWrapper -
Method Summary
Modifier and TypeMethodDescriptionappStart(JSONObject xMetadata) Submit the appStart Activity Must be the first activity submitted (must be called before any other calls to submitActivity) Should not be called again without first submitting an appStop activityvoidclose()Close the analytics session After calling this method, do not call any other unless initialise is called againinitialise(JSONObject xWrapperConfig, JSONObject xAgentConfig, OtvAnalyticsAgent.OtvAaReportListener xReportListener) Initialise the OpenTv Analytics Agent and Wrapper Call this method once, before calling any other Do not call again unless close is called firstbooleanCheck if the wrapper is initialisedplaybackStart(JSONObject xMetadata, nagra.insight.agent.utils.ContentInfoHolder xInsightContentInfo, nagra.insight.agent.utils.UserInfoHolder xInsightUserInfo) Submit the playbackStart Activity Should be called after a player has been set for the wrappersetConnectPlayer(nagra.otv.sdk.OTVVideoView xPlayer) Provide a reference to a Nagra Connect Player which may be used to automatically detect some activities, and populate some metadata Must be called before submitting the playbackStart activity Must not be changed or removed between playbackStart and playbackStop activities Player may be removed by passing a null referencesubmitActivity(OtvActivity xActivity, JSONObject xMetadata) Submit an activity appStart activity should not be submitted using this methodupdateConfig(JSONObject xWrapperConfig, JSONObject xAgentConfig) Provide an updated configuration The configuration object should only contain the updated attributes.
-
Field Details
-
SAMPLE_PERIOD
- See Also:
-
-
Constructor Details
-
OtvAnalyticsAgentWrapper
Constructor for OtvAnalyticsAgentWrapper- Parameters:
xContext- the context used by Insight Agent Insight Agent will be disabled if context is null
-
-
Method Details
-
initialise
public OtvAaError initialise(@NonNull JSONObject xWrapperConfig, @NonNull JSONObject xAgentConfig, @NonNull OtvAnalyticsAgent.OtvAaReportListener xReportListener) Initialise the OpenTv Analytics Agent and Wrapper Call this method once, before calling any other Do not call again unless close is called first- Parameters:
xWrapperConfig- Configuration for the wrapperxAgentConfig- Configuration for the OtvAnalyticsAgentxReportListener- Reference for listener to handle errors- Returns:
- error object to be defined
-
isInitialised
public boolean isInitialised()Check if the wrapper is initialised- Returns:
- true if initialised, false otherwise
-
close
public void close()Close the analytics session After calling this method, do not call any other unless initialise is called again -
updateConfig
public OtvAaError updateConfig(@NonNull JSONObject xWrapperConfig, @NonNull JSONObject xAgentConfig) Provide an updated configuration The configuration object should only contain the updated attributes. Not all attributes may be updated If either object does not need to be updated, an empty object {} may be provided- Parameters:
xWrapperConfig- updated configuration for the wrapperxAgentConfig- updated configuration for the OtvAnalyticsAgent- Returns:
- error object to be defined
-
setConnectPlayer
Provide a reference to a Nagra Connect Player which may be used to automatically detect some activities, and populate some metadata Must be called before submitting the playbackStart activity Must not be changed or removed between playbackStart and playbackStop activities Player may be removed by passing a null reference- Parameters:
xPlayer- {OTVVideoView} player Reference to a Nagra Connect Player- Returns:
- error object to be defined
-
appStart
Submit the appStart Activity Must be the first activity submitted (must be called before any other calls to submitActivity) Should not be called again without first submitting an appStop activity- Parameters:
xMetadata- {JSONObject} metadata Containing key-value pairs of metadata for the appStart activity- Returns:
- error object to be defined
-
playbackStart
public OtvAaError playbackStart(@NonNull JSONObject xMetadata, @Nullable nagra.insight.agent.utils.ContentInfoHolder xInsightContentInfo, @Nullable nagra.insight.agent.utils.UserInfoHolder xInsightUserInfo) Submit the playbackStart Activity Should be called after a player has been set for the wrapper- Parameters:
xMetadata- {JSONObject} metadata Containing key-value pairs of metadata for the playbackStart activityxInsightContentInfo- {ContentInfoHolder} if Insight reporting is required.xInsightUserInfo- {UserInfoHolder} if Insight reporting is required.- Returns:
- error object
-
submitActivity
Submit an activity appStart activity should not be submitted using this method- Parameters:
xActivity- {OtvActivity} activity The activity being submittedxMetadata- {JSONObject} metadata Containing key-value pairs of metadata for the submitted activity- Returns:
- error object to be defined
-