Package com.castlabs.android.player

# Class BasePlayerModelBuilder

java.lang.Object
com.castlabs.android.player.BasePlayerModelBuilder

public class BasePlayerModelBuilder extends Object
Helper class that takes care of the track renderer creation using the registered `TrackRendererPlugin` plugins.

Since:
  3.0.0

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `BasePlayerModelBuilder()`
  Default constructor.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `TrackRendererPlugin.TrackRendererContainer`
  `createRenderer(PlayerController playerController, CasConfiguration casConfiguration, TrackRendererPlugin.Type type)`
  Creates a `TrackRendererPlugin.TrackRendererContainer` for the given parameters.
  `TrackRendererPlugin.TrackRendererContainer`
  `createRenderer(PlayerController playerController, DrmConfiguration drmConfiguration, TrackRendererPlugin.Type type)`
  Creates a `TrackRendererPlugin.TrackRendererContainer` for the given parameters.
  `com.google.android.exoplayer2.RendererCapabilities`
  `getRendererCapabilities(Context context, TrackRendererPlugin.Type type, DrmConfiguration drmConfiguration)`
  Returns the `RendererCapabilities` for the given `TrackRendererPlugin.Type` and `DrmConfiguration`.

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

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

- ## Constructor Details

  - ### BasePlayerModelBuilder

    public BasePlayerModelBuilder()
    Default constructor.

- ## Method Details

  - ### getRendererCapabilities

    @Nullable public com.google.android.exoplayer2.RendererCapabilities getRendererCapabilities(@NonNull Context context, TrackRendererPlugin.Type type, @Nullable DrmConfiguration drmConfiguration)
    Returns the `RendererCapabilities` for the given `TrackRendererPlugin.Type` and `DrmConfiguration`.
    Parameters:
      `context` - The context.
      `type` - The track type.
      `drmConfiguration` - The DRM configuration.
    Returns:
      The renderer capabilities or `null` if no suitable builder was found.

  - ### createRenderer

    @NonNull public TrackRendererPlugin.TrackRendererContainer createRenderer(@NonNull PlayerController playerController, @Nullable DrmConfiguration drmConfiguration, TrackRendererPlugin.Type type) throws CastlabsPlayerException
    Creates a `TrackRendererPlugin.TrackRendererContainer` for the given parameters.
    Parameters:
      `playerController` - The player controller.
      `drmConfiguration` - The DRM configuration.
      `type` - The track type.
    Returns:
      The created track renderer container.
    Throws:
      `CastlabsPlayerException` - If no suitable builder was found or an error occurred during creation.

  - ### createRenderer

    public TrackRendererPlugin.TrackRendererContainer createRenderer(@NonNull PlayerController playerController, @Nullable CasConfiguration casConfiguration, @NonNull TrackRendererPlugin.Type type) throws CastlabsPlayerException
    Creates a `TrackRendererPlugin.TrackRendererContainer` for the given parameters.
    Parameters:
      `playerController` - The player controller.
      `casConfiguration` - The CAS configuration.
      `type` - The track type.
    Returns:
      The created track renderer container.
    Throws:
      `CastlabsPlayerException` - If no suitable builder was found or an error occurred during creation.