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
  `DrmLicenseManager`
  `createDrmLicenseManager(Context context, TrackRendererPlugin.Type type, DrmConfiguration drmConfiguration, ConfigurationProvider configurationProvider, SSLSocketFactory sslSocketFactory, DataSourceFactory dataSourceFactory, NetworkConfiguration networkConfiguration, List<RequestModifier> requestModifiers, List<ResponseModifier> responseModifiers)`
  Returns the `DrmLicenseManager` for the given `TrackRendererPlugin.Type` and `DrmConfiguration`.
  `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

  - ### createDrmLicenseManager

    @Nullable public DrmLicenseManager createDrmLicenseManager(@NonNull Context context, @NonNull TrackRendererPlugin.Type type, @Nullable DrmConfiguration drmConfiguration, @Nullable ConfigurationProvider configurationProvider, @Nullable SSLSocketFactory sslSocketFactory, @NonNull DataSourceFactory dataSourceFactory, @NonNull NetworkConfiguration networkConfiguration, @NonNull List<RequestModifier> requestModifiers, @NonNull List<ResponseModifier> responseModifiers)
    Returns the `DrmLicenseManager` for the given `TrackRendererPlugin.Type` and `DrmConfiguration`.
    Parameters:
      `context` - The context.
      `type` - The track type.
      `drmConfiguration` - The DRM configuration.
      `configurationProvider` - The configuration provider `null`
      `sslSocketFactory` - The SSL socket factory or `null`
      `dataSourceFactory` - The data source factory
      `networkConfiguration` - THe network configuration
      `requestModifiers` - The list of request modifiers
      `responseModifiers` - The list of response modifiers
    Returns:
      The `DrmLicenseManager` or `null` if no suitable builder was found.

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