Package com.castlabs.android.player

# Interface TrackRendererPlugin.TrackRendererBuilder

All Known Implementing Classes:
  `ClearkeyTrackRendererBuilder`

Enclosing interface:
  `TrackRendererPlugin`

public static interface TrackRendererPlugin.TrackRendererBuilder
Implementations of the builder a responsible to create `Renderer` instances. The player will create one instance of this builder.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `default 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(TrackRendererPlugin.Type type, PlayerController playerController, DrmConfiguration configuration)`
  Creates a track renderer container for the given type, player controller and DRM configuration.
  `com.google.android.exoplayer2.RendererCapabilities`
  `getRendererCapabilities(Context context, TrackRendererPlugin.Type type, DrmConfiguration drmConfiguration)`
  Returns the renderer capabilities for the given type and DRM configuration.
  `boolean`
  `isDefault()`
  Checks if this builder is the default one.
  `boolean`
  `isTypeSupported(TrackRendererPlugin.Type type, DrmConfiguration configuration)`
  Checks if this builder supports the given type and DRM configuration.

- ## Method Details

  - ### isTypeSupported

    boolean isTypeSupported(@NonNull TrackRendererPlugin.Type type, @Nullable DrmConfiguration configuration)
    Checks if this builder supports the given type and DRM configuration.
    Parameters:
      `type` - the content type
      `configuration` - the drm configuration
    Returns:
      true if this builder supports the given type and configuration

  - ### isDefault

    boolean isDefault()
    Checks if this builder is the default one.
    Returns:
      true if this builder is the default one

  - ### createDrmLicenseManager

    @Nullable default 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) throws CastlabsPlayerException
    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.
    Throws:
      `CastlabsPlayerException` - in case of an error while preparing the `DrmLicenseManager`

  - ### getRendererCapabilities

    @Nullable com.google.android.exoplayer2.RendererCapabilities getRendererCapabilities(@NonNull Context context, @NonNull TrackRendererPlugin.Type type, @Nullable DrmConfiguration drmConfiguration) throws CastlabsPlayerException
    Returns the renderer capabilities for the given type and DRM configuration.
    Parameters:
      `context` - the context
      `type` - the content type
      `drmConfiguration` - the drm configuration
    Returns:
      RendererCapabilities if this builder supports the given type and configuration
    Throws:
      `CastlabsPlayerException` - in case of an error while preparing the renderer

  - ### createRenderer

    @Nullable TrackRendererPlugin.TrackRendererContainer createRenderer(@NonNull TrackRendererPlugin.Type type, @NonNull PlayerController playerController, @Nullable DrmConfiguration configuration) throws CastlabsPlayerException
    Creates a track renderer container for the given type, player controller and DRM configuration.
    Parameters:
      `type` - the content type
      `playerController` - the player controller
      `configuration` - the drm configuration
    Returns:
      the created track renderer container or null
    Throws:
      `CastlabsPlayerException` - in case of an error while preparing the renderer