Package com.castlabs.analytics

# Class AnalyticsSessionProxy

java.lang.Object
com.castlabs.analytics.AnalyticsSession
com.castlabs.analytics.AnalyticsSessionProxy

All Implemented Interfaces:
  `IAnalyticsSession`, `PlayerControllerPlugin.Component`

public class AnalyticsSessionProxy extends AnalyticsSession
Proxy which extends `AnalyticsSession` that can delegate to a list of session.

Since:
  3.1.0

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `AnalyticsSessionProxy(List<AnalyticsSession> sessions)`
  Creates a new instance of `AnalyticsSessionProxy`.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `adErrorInternal(Ad ad, CastlabsPlayerException exception)`
  `void`
  `adSkippedInternal()`
  `void`
  `adStartInternal(Ad ad)`
  `void`
  `adStopInternal()`
  `void`
  `adWillStartInternal(Ad ad)`
  `void`
  `detachFromControllerInternal()`
  `List<AnalyticsSession>`
  `getSessions()`
  Returns the list of sessions this proxy delegates to.
  `Class`
  `id()`
  Returns the class that is used to identify this component when it is registered with the player controller.
  `void`
  `onDestroy(PlayerController playerController)`
  Called when the controller is destroyed.
  `void`
  `onExoPlayerStateChangedInternal(boolean playWhenReady, int playbackState)`
  `void`
  `onOpenBundle(PlayerController playerController, Bundle bundle)`
  Called when the player controller is opened with a bundle.
  `void`
  `onOpenState(PlayerController playerController, PlayerConfig playerConfig)`
  Called when the player controller is opened with a config.
  `void`
  `releaseInternal()`
  `void`
  `reportPlayerStateInternal(PlayerController.State state)`
  `void`
  `seekEndInternal()`
  `void`
  `seekStartInternal(long newPosition)`
  `void`
  `sendErrorInternal(String code, String message, int severity)`
  `void`
  `setEnabled(boolean enabled)`
  Enable or disable the session.
  `void`
  `startInternal(PlayerController playerController, AnalyticsMetaData analyticsMetaData)`
  `void`
  `stopInternal()`

  ### Methods inherited from class com.castlabs.analytics.AnalyticsSession

  `adClick, adError, adPause, adResume, adSkipped, adStart, adStop, adWillStart, detachFromController, getEnabled, onExoPlayerStateChanged, release, reportPlayerState, seekEnd, seekStart, sendError, start, stop`

  ### Methods inherited from class java.lang.Object

  `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### AnalyticsSessionProxy

    public AnalyticsSessionProxy(@Nullable List<AnalyticsSession> sessions)
    Creates a new instance of `AnalyticsSessionProxy`.
    Parameters:
      `sessions` - The list of sessions to delegate to.

- ## Method Details

  - ### getSessions

    @Nullable public List<AnalyticsSession> getSessions()
    Returns the list of sessions this proxy delegates to.
    Returns:
      The list of sessions.

  - ### setEnabled

    public void setEnabled(boolean enabled)
    Description copied from class: `AnalyticsSession`
    Enable or disable the session.
    Overrides:
      `setEnabled` in class `AnalyticsSession`
    Parameters:
      `enabled` - the value

  - ### startInternal

    public void startInternal(@NonNull PlayerController playerController, @NonNull AnalyticsMetaData analyticsMetaData)

  - ### stopInternal

    public void stopInternal()

  - ### adWillStartInternal

    public void adWillStartInternal(Ad ad)

  - ### adStartInternal

    public void adStartInternal(Ad ad)

  - ### adStopInternal

    public void adStopInternal()

  - ### adErrorInternal

    public void adErrorInternal(Ad ad, CastlabsPlayerException exception)

  - ### adSkippedInternal

    public void adSkippedInternal()

  - ### reportPlayerStateInternal

    public void reportPlayerStateInternal(PlayerController.State state)

  - ### sendErrorInternal

    public void sendErrorInternal(String code, String message, int severity)

  - ### seekStartInternal

    public void seekStartInternal(long newPosition)

  - ### seekEndInternal

    public void seekEndInternal()

  - ### detachFromControllerInternal

    public void detachFromControllerInternal()

  - ### releaseInternal

    public void releaseInternal()

  - ### onExoPlayerStateChangedInternal

    public void onExoPlayerStateChangedInternal(boolean playWhenReady, int playbackState)

  - ### id

    @NonNull public Class id()
    Description copied from interface: `PlayerControllerPlugin.Component`
    Returns the class that is used to identify this component when it is registered with the player controller. This is what you need to pass to `PlayerController.getComponent(Class)` to get the registered instance of this component.
    Returns:
      The class that identifies this component.

  - ### onDestroy

    public void onDestroy(@NonNull PlayerController playerController)
    Description copied from interface: `PlayerControllerPlugin.Component`
    Called when the controller is destroyed. Implementation must use this to unregister any listeners that were attached to the controller before.
    Parameters:
      `playerController` - The player controller

  - ### onOpenBundle

    public void onOpenBundle(@NonNull PlayerController playerController, @NonNull Bundle bundle)
    Description copied from interface: `PlayerControllerPlugin.Component`
    Called when the player controller is opened with a bundle. Implementations can use this to extract or modify bundle data.
    Parameters:
      `playerController` - The player controller
      `bundle` - The bundle

  - ### onOpenState

    public void onOpenState(PlayerController playerController, PlayerConfig playerConfig)
    Description copied from interface: `PlayerControllerPlugin.Component`
    Called when the player controller is opened with a config. Implementations can use this to extract or modify config data.
    Parameters:
      `playerController` - The player controller
      `playerConfig` - The playback state