Package com.castlabs.sdk.youbora

# Class YouboraAnalyticsSession

java.lang.Object
com.castlabs.analytics.AnalyticsSession
com.castlabs.sdk.youbora.YouboraAnalyticsSession

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

public class YouboraAnalyticsSession extends AnalyticsSession implements SingleControllerPlaylist.PlaylistListener
Youbora Analytics Session implementation

Since:
  3.1.0

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `detachFromControllerInternal()`
  `com.npaw.NpawPlugin`
  `getYouboraPlugin()`
  Return the underlying instance of the Youbora `NpawPlugin` API.
  `Class`
  `id()`
  `void`
  `onDestroy(PlayerController playerController)`
  `void`
  `onExoPlayerStateChangedInternal(boolean playWhenReady, int playbackState)`
  `void`
  `onItemChange(PlayerConfig config)`
  `void`
  `onOpenBundle(PlayerController playerController, Bundle bundle)`
  `void`
  `onOpenState(PlayerController playerController, PlayerConfig playerConfig)`
  `void`
  `onPlaylistEnded()`
  `void`
  `releaseInternal()`
  `void`
  `reportPlayerStateInternal(PlayerController.State state)`
  `void`
  `seekEndInternal()`
  `void`
  `seekProcessedInternal()`
  `void`
  `seekStartInternal(long newPosition)`
  `void`
  `sendErrorInternal(String code, String message, int severity)`
  `void`
  `setPlugin(com.npaw.NpawPlugin youboraPlugin)`
  Sets the Youbora `NpawPlugin` instance to use.
  `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, seekProcessed, seekStart, sendError, setEnabled, start, stop`

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

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

- ## Method Details

  - ### startInternal

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

  - ### detachFromControllerInternal

    public void detachFromControllerInternal()

  - ### onExoPlayerStateChangedInternal

    public void onExoPlayerStateChangedInternal(boolean playWhenReady, int playbackState)

  - ### stopInternal

    public void stopInternal()

  - ### releaseInternal

    public void releaseInternal()

  - ### 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()

  - ### seekProcessedInternal

    public void seekProcessedInternal()

  - ### getYouboraPlugin

    @Nullable public com.npaw.NpawPlugin getYouboraPlugin()
    Return the underlying instance of the Youbora `NpawPlugin` API. May be `null` if the session is not yet started.
    Returns:
      the underlying instance of the Youbora Plugin API.

  - ### id

    @NonNull public Class id()
    Specified by:
      `id` in interface `PlayerControllerPlugin.Component`

  - ### onDestroy

    public void onDestroy(@NonNull PlayerController playerController)
    Specified by:
      `onDestroy` in interface `PlayerControllerPlugin.Component`

  - ### onOpenBundle

    public void onOpenBundle(@NonNull PlayerController playerController, @NonNull Bundle bundle)
    Specified by:
      `onOpenBundle` in interface `PlayerControllerPlugin.Component`

  - ### onOpenState

    public void onOpenState(PlayerController playerController, PlayerConfig playerConfig)
    Specified by:
      `onOpenState` in interface `PlayerControllerPlugin.Component`

  - ### onItemChange

    public void onItemChange(@NonNull PlayerConfig config)
    Specified by:
      `onItemChange` in interface `SingleControllerPlaylist.PlaylistListener`

  - ### onPlaylistEnded

    public void onPlaylistEnded()
    Specified by:
      `onPlaylistEnded` in interface `SingleControllerPlaylist.PlaylistListener`

  - ### setPlugin

    public void setPlugin(@Nullable com.npaw.NpawPlugin youboraPlugin)
    Sets the Youbora `NpawPlugin` instance to use. Note that calling this method is not needed in case the `YouboraPlugin` was already `created` with a NpawPlugin instance. Should be called before `opening` the player.
    Parameters:
      `youboraPlugin` - Youbora `NpawPlugin` instance to use.