Package com.nagra.otvaa.sdk
Class OtvAnalyticsAgentWrapper
java.lang.Object
com.nagra.otvaa.sdk.OtvAnalyticsAgentWrapper
This class wrapping the OtvAnalyticsAgent for use by player SDKs.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic @interface
Player types for analytics. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Player type for Bitmovin Player.static final int
Player type for Nagra Connect Player.static final String
-
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 activityvoid
close()
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 firstboolean
Check if the wrapper is initialisedplaybackStart
(JSONObject xMetadata, ContentInfoHolder xInsightContentInfo, UserInfoHolder xInsightUserInfo) Submit the playbackStart Activity Should be called after a player has been set for the wrapperProvide a reference to a 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
-
PLAYER_TYPE_CONNECT
public static final int PLAYER_TYPE_CONNECTPlayer type for Nagra Connect Player.- See Also:
-
PLAYER_TYPE_BITMOVIN
public static final int PLAYER_TYPE_BITMOVINPlayer type for Bitmovin Player.- See Also:
-
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
-
setPlayer
Provide a reference to a 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
- {Ojbect} player Reference to a PlayerxPlayerType
- {int} player type. one ofPLAYER_TYPE_CONNECT
PLAYER_TYPE_BITMOVIN
- 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 ContentInfoHolder xInsightContentInfo, @Nullable 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
-