Package com.castlabs.sdk.youbora

## Class YouboraAnalyticsSession

- java.lang.Object
- - com.castlabs.sdk.youbora.YouboraAnalyticsSession

- All Implemented Interfaces:
    `AnalyticsSession`, `PlayerControllerPlugin.Component`

      public class YouboraAnalyticsSession
      extends Object
      implements AnalyticsSession

  Since:
    3.1.0

- - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `adError​(CastlabsPlayerException exception)` |
    `void` | `adSkipped()` |
    `void` | `adStart​(Ad ad)` |
    `void` | `adStop()` |
    `void` | `detachFromController()` |
    `com.npaw.youbora.lib6.plugin.Plugin` | `getYouboraPlugin()` | Return the underlying instance of the Youbora `Plugin` API.
    `Class` | `id()` |
    `void` | `onDestroy​(PlayerController playerController)` |
    `void` | `onExoPlayerStateChanged​(boolean playWhenReady, int playbackState)` |
    `void` | `onOpenBundle​(PlayerController playerController, Bundle bundle)` |
    `void` | `onOpenState​(PlayerController playerController, PlayerConfig playerConfig)` |
    `void` | `release()` |
    `void` | `seekEnd()` |
    `void` | `seekProcessed()` |
    `void` | `seekStart​(long newPosition)` |
    `void` | `sendError​(String code, String message, int severity)` |
    `void` | `setPlugin​(com.npaw.youbora.lib6.plugin.Plugin youboraPlugin)` | Sets the Youbora `Plugin` instance to use.
    `void` | `start​(PlayerController playerController, AnalyticsMetaData analyticsMetaData)` |
    `void` | `stop()` |

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

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

- - ### Method Detail

    - #### start

          public void start​(@NonNull
                            PlayerController playerController,
                            @NonNull
                            AnalyticsMetaData analyticsMetaData)

      Specified by:
        `start` in interface `AnalyticsSession`

    - #### detachFromController

          public void detachFromController()

      Specified by:
        `detachFromController` in interface `AnalyticsSession`

    - #### onExoPlayerStateChanged

          public void onExoPlayerStateChanged​(boolean playWhenReady,
                                              int playbackState)

      Specified by:
        `onExoPlayerStateChanged` in interface `AnalyticsSession`

    - #### stop

          public void stop()

      Specified by:
        `stop` in interface `AnalyticsSession`

    - #### release

          public void release()

      Specified by:
        `release` in interface `AnalyticsSession`

    - #### adStart

          public void adStart​(Ad ad)

      Specified by:
        `adStart` in interface `AnalyticsSession`

    - #### adStop

          public void adStop()

      Specified by:
        `adStop` in interface `AnalyticsSession`

    - #### adError

          public void adError​(CastlabsPlayerException exception)

      Specified by:
        `adError` in interface `AnalyticsSession`

    - #### adSkipped

          public void adSkipped()

      Specified by:
        `adSkipped` in interface `AnalyticsSession`

    - #### sendError

          public void sendError​(String code,
                                String message,
                                int severity)

      Specified by:
        `sendError` in interface `AnalyticsSession`

    - #### seekStart

          public void seekStart​(long newPosition)

      Specified by:
        `seekStart` in interface `AnalyticsSession`

    - #### seekEnd

          public void seekEnd()

      Specified by:
        `seekEnd` in interface `AnalyticsSession`

    - #### seekProcessed

          public void seekProcessed()

      Specified by:
        `seekProcessed` in interface `AnalyticsSession`

    - #### getYouboraPlugin

          @Nullable
          public com.npaw.youbora.lib6.plugin.Plugin getYouboraPlugin()

      Return the underlying instance of the Youbora `Plugin` 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`

    - #### setPlugin

          public void setPlugin​(@Nullable
                                com.npaw.youbora.lib6.plugin.Plugin youboraPlugin)

      Sets the Youbora `Plugin` instance to use. Note that calling this method is not needed in case the `YouboraPlugin` was already `created` with a Plugin instance. Should be called before `opening` the player.
      Parameters:
        `youboraPlugin` - Youbora `Plugin` instance to use.