Package com.castlabs.android.player

# Interface PlayerControllerPlugin.Component

All Known Subinterfaces:
  `IAnalyticsSession`, `PlayerControllerPlugin.VisualComponent`

All Known Implementing Classes:
  `AnalyticsSession`, `AnalyticsSessionProxy`, `ExoSubtitlesRendererPlugin.ExoSubtitleComponent`, `VisualComponentProxy`

Enclosing interface:
  `PlayerControllerPlugin`

public static interface PlayerControllerPlugin.Component
Implementations of this component can be used to gain controlled access to a `PlayerController`.

The component can use the `PlayerController` to add event listeners and get callbacks during the playback lifecycle.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `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`
  `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.

- ## Method Details

  - ### id

    @NonNull Class id()
    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

    void onDestroy(@NonNull PlayerController playerController)
    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

    void onOpenBundle(@NonNull PlayerController playerController, @NonNull Bundle bundle)
    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

    void onOpenState(PlayerController playerController, PlayerConfig playerConfig)
    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