Class OtvAnalyticsAgentWrapper

java.lang.Object
com.nagra.otvaa.sdk.OtvAnalyticsAgentWrapper

public class OtvAnalyticsAgentWrapper extends Object
This class wrapping the OtvAnalyticsAgent for use by the Nagra Connect Player (OTVVideoView)
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor for OtvAnalyticsAgentWrapper
  • Method Summary

    Modifier and Type
    Method
    Description
    appStart(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 activity
    void
    Close the analytics session After calling this method, do not call any other unless initialise is called again
    initialise(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 first
    boolean
    Check if the wrapper is initialised
    playbackStart(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 wrapper
    setConnectPlayer(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 reference
    submitActivity(OtvActivity xActivity, JSONObject xMetadata)
    Submit an activity appStart activity should not be submitted using this method
    updateConfig(JSONObject xWrapperConfig, JSONObject xAgentConfig)
    Provide an updated configuration The configuration object should only contain the updated attributes.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • OtvAnalyticsAgentWrapper

      public OtvAnalyticsAgentWrapper(@NonNull Context xContext)
      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 wrapper
      xAgentConfig - Configuration for the OtvAnalyticsAgent
      xReportListener - 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 wrapper
      xAgentConfig - updated configuration for the OtvAnalyticsAgent
      Returns:
      error object to be defined
    • setConnectPlayer

      public OtvAaError setConnectPlayer(@Nullable 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 reference
      Parameters:
      xPlayer - {OTVVideoView} player Reference to a Nagra Connect Player
      Returns:
      error object to be defined
    • appStart

      public OtvAaError appStart(@Nullable 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 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 activity
      xInsightContentInfo - {ContentInfoHolder} if Insight reporting is required.
      xInsightUserInfo - {UserInfoHolder} if Insight reporting is required.
      Returns:
      error object
    • submitActivity

      public OtvAaError submitActivity(@NonNull OtvActivity xActivity, @Nullable JSONObject xMetadata)
      Submit an activity appStart activity should not be submitted using this method
      Parameters:
      xActivity - {OtvActivity} activity The activity being submitted
      xMetadata - {JSONObject} metadata Containing key-value pairs of metadata for the submitted activity
      Returns:
      error object to be defined