Package com.castlabs.android.hybridads

# Class HybridAdComponent

java.lang.Object
com.castlabs.android.hybridads.HybridAdComponent

All Implemented Interfaces:
  `PlayerControllerPlugin.Component`

public class HybridAdComponent extends Object implements PlayerControllerPlugin.Component
Component for managing hybrid ads.

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static interface`
  `HybridAdComponent.AdVisibilityListener`
  Listener for ad visibility changes.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `HybridAdComponent(HybridAdPlayerPlugin hybridAdPlayerPluginWeakReference, HybridAdTrackRendererPlugin hybridAdTrackRendererPlugin)`
  Constructor for HybridAdComponent.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Class`
  `id()`
  `void`
  `onDestroy(PlayerController playerController)`
  `void`
  `onOpenBundle(PlayerController playerController, Bundle bundle)`
  `void`
  `onOpenState(PlayerController playerController, PlayerConfig playerConfig)`
  `void`
  `setAdPlayerInfo(com.castlabs.android.tunerhal.aidl.IPlayerService playerService, int instance, long splicePts, long adDuration)`
  Sets the ad player information.
  `void`
  `setContext(Context context, FrameLayout frameLayout, HybridAdComponent.AdVisibilityListener listener)`
  Sets the context, frame layout and listener.
  `void`
  `toggleToAdSurface(boolean toggle)`
  Toggles to ad surface.

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

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

- ## Constructor Details

  - ### HybridAdComponent

    public HybridAdComponent(HybridAdPlayerPlugin hybridAdPlayerPluginWeakReference, HybridAdTrackRendererPlugin hybridAdTrackRendererPlugin)
    Constructor for HybridAdComponent.
    Parameters:
      `hybridAdPlayerPluginWeakReference` - Weak reference to HybridAdPlayerPlugin.
      `hybridAdTrackRendererPlugin` - Weak reference to HybridAdTrackRendererPlugin.

- ## Method Details

  - ### setAdPlayerInfo

    public void setAdPlayerInfo(com.castlabs.android.tunerhal.aidl.IPlayerService playerService, int instance, long splicePts, long adDuration)
    Sets the ad player information.
    Parameters:
      `playerService` - The player service.
      `instance` - The instance.
      `splicePts` - The splice points.
      `adDuration` - The ad duration.

  - ### setContext

    public void setContext(Context context, FrameLayout frameLayout, HybridAdComponent.AdVisibilityListener listener)
    Sets the context, frame layout and listener.
    Parameters:
      `context` - The context.
      `frameLayout` - The frame layout.
      `listener` - The ad visibility listener.

  - ### toggleToAdSurface

    public void toggleToAdSurface(boolean toggle)
    Toggles to ad surface.
    Parameters:
      `toggle` - True to toggle to ad surface, false otherwise.

  - ### 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`