Class OtvAnalyticsAgentWrapper

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

public class OtvAnalyticsAgentWrapper extends Object
This class wrapping the OtvAnalyticsAgent for use by player SDKs.
  • Field Details

    • PLAYER_TYPE_CONNECT

      public static final int PLAYER_TYPE_CONNECT
      Player type for Nagra Connect Player.
      See Also:
    • PLAYER_TYPE_BITMOVIN

      public static final int PLAYER_TYPE_BITMOVIN
      Player type for Bitmovin Player.
      See Also:
    • SAMPLE_PERIOD

      public static final String SAMPLE_PERIOD
      See Also:
  • 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
    • setPlayer

      public OtvAaError setPlayer(@Nullable Object xPlayer, int xPlayerType)
      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 Player
      xPlayerType - {int} player type. one of PLAYER_TYPE_CONNECT PLAYER_TYPE_BITMOVIN
      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 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 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