Package com.castlabs.sdk.youbora

# Class YouboraPlugin

java.lang.Object
com.castlabs.android.Plugin
com.castlabs.sdk.youbora.YouboraPlugin

public class YouboraPlugin extends Plugin
This plugin integrates Youbora Analytics with the castLabs Player SDK. You can enable and register the plugin before you initialize the SDK:

      public class MyApp extends Application {
         @Override
          public void onCreate() {
              super.onCreate();

              YouboraPlugin youbora = new YouboraPlugin(...);
              PlayerSDK.register(youbora);
              PlayerSDK.init(getApplicationContext());
          }
     }

Since:
  3.1.5

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static boolean`
  `ENABLE_OFFLINE_ANALYTICS`
  Whether to send offline analytics or not.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `YouboraPlugin(String systemId)`
  Create a new instance of this plugin using the default configuration.
  `YouboraPlugin(String systemId, com.npaw.youbora.lib6.plugin.Plugin youboraPlugin)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static AnalyticsMetaData`
  `createMetadata(boolean live, String assetId, com.npaw.youbora.lib6.plugin.Options youboraOptions)`
  Create an `AnalyticsMetaData` object from a Youbora `Options` object.
  `static AnalyticsMetaData`
  `createMetadata(AnalyticsMetaData analyticsMetaData, com.npaw.youbora.lib6.plugin.Options youboraOptions)`
  Update provided analytics metadata with extra values
  `String`
  `getId()`
  `void`
  `init(Context context)`
  `void`
  `reportWarnings(boolean reportWarnings)`
  Whether to report the SDK Warnings as Youbora non-fatal errors.
  `void`
  `setEnabled(boolean enabled)`

  ### Methods inherited from class com.castlabs.android.Plugin

  `onRemotePlay`

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

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

- ## Field Details

  - ### ENABLE_OFFLINE_ANALYTICS

    public static boolean ENABLE_OFFLINE_ANALYTICS
    Whether to send offline analytics or not. If disabled, current stored offline sessions sending through `flushYouboraEvents(Context, String, com.npaw.youbora.lib6.plugin.Plugin)` will also be blocked.

- ## Constructor Details

  - ### YouboraPlugin

    public YouboraPlugin(@NonNull String systemId)
    Create a new instance of this plugin using the default configuration.
    Parameters:
      `systemId` - The Youbora system id

  - ### YouboraPlugin

    public YouboraPlugin(@NonNull String systemId, @NonNull com.npaw.youbora.lib6.plugin.Plugin youboraPlugin)

- ## Method Details

  - ### init

    public void init(Context context)
    Overrides:
      `init` in class `Plugin`

  - ### reportWarnings

    public void reportWarnings(boolean reportWarnings)
    Whether to report the SDK Warnings as Youbora non-fatal errors. If disabled, fatal errors will still be reported. Default: false
    Parameters:
      `reportWarnings` - Whether to report the SDK Warnings as Youbora non-fatal errors

  - ### getId

    @NonNull public String getId()
    Specified by:
      `getId` in class `Plugin`

  - ### setEnabled

    public void setEnabled(boolean enabled)

  - ### createMetadata

    public static AnalyticsMetaData createMetadata(boolean live, @NonNull String assetId, @Nullable com.npaw.youbora.lib6.plugin.Options youboraOptions)
    Create an `AnalyticsMetaData` object from a Youbora `Options` object.
    Parameters:
      `live` - whether the asset is a live stream or not
      `assetId` - unique asset identifier
      `youboraOptions` - instance of a pre-configured `Options` object.
    Returns:
      instance of AnalyticsMetaData

  - ### createMetadata

    public static AnalyticsMetaData createMetadata(@NonNull AnalyticsMetaData analyticsMetaData, @Nullable com.npaw.youbora.lib6.plugin.Options youboraOptions)
    Update provided analytics metadata with extra values
    Parameters:
      `analyticsMetaData` - Initial metadata to update with extra values
      `youboraOptions` - instance of a pre-configured `Options` object.
    Returns:
      instance of AnalyticsMetaData