Package com.castlabs.android.player

# Class ClearkeyTrackRendererBuilder

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

All Implemented Interfaces:
  `TrackRendererPlugin.TrackRendererBuilder`

public class ClearkeyTrackRendererBuilder extends Object
A `MediaCodecTrackRendererBuilder` that builds `Renderer` instances that support Clearkey DRM.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ClearkeyTrackRendererBuilder()`
  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(TrackRendererPlugin.Type type, PlayerController playerController, DrmConfiguration drmConfiguration)`
  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.

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

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

- ## Constructor Details

  - ### ClearkeyTrackRendererBuilder

    public ClearkeyTrackRendererBuilder()
    Default constructor.

- ## Method Details

  - ### isTypeSupported

    public boolean isTypeSupported(@NonNull TrackRendererPlugin.Type type, @Nullable DrmConfiguration configuration)
    Description copied from interface: `TrackRendererPlugin.TrackRendererBuilder`
    Checks if this builder supports the given type and DRM configuration.
    Specified by:
      `isTypeSupported` in interface `TrackRendererPlugin.TrackRendererBuilder`
    Parameters:
      `type` - the content type
      `configuration` - the drm configuration
    Returns:
      true if this builder supports the given type and configuration

  - ### isDefault

    public boolean isDefault()
    Description copied from interface: `TrackRendererPlugin.TrackRendererBuilder`
    Checks if this builder is the default one.
    Specified by:
      `isDefault` in interface `TrackRendererPlugin.TrackRendererBuilder`
    Returns:
      true if this builder is the default one

  - ### 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) throws CastlabsPlayerException
    Description copied from interface: `TrackRendererPlugin.TrackRendererBuilder`
    Returns the `DrmLicenseManager` for the given `TrackRendererPlugin.Type` and `DrmConfiguration`.
    Specified by:
      `createDrmLicenseManager` in interface `TrackRendererPlugin.TrackRendererBuilder`
    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 public com.google.android.exoplayer2.RendererCapabilities getRendererCapabilities(@NonNull Context context, @NonNull TrackRendererPlugin.Type type, @Nullable DrmConfiguration drmConfiguration) throws CastlabsPlayerException
    Description copied from interface: `TrackRendererPlugin.TrackRendererBuilder`
    Returns the renderer capabilities for the given type and DRM configuration.
    Specified by:
      `getRendererCapabilities` in interface `TrackRendererPlugin.TrackRendererBuilder`
    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 public TrackRendererPlugin.TrackRendererContainer createRenderer(@NonNull TrackRendererPlugin.Type type, @NonNull PlayerController playerController, @Nullable DrmConfiguration drmConfiguration) throws CastlabsPlayerException
    Description copied from interface: `TrackRendererPlugin.TrackRendererBuilder`
    Creates a track renderer container for the given type, player controller and DRM configuration.
    Specified by:
      `createRenderer` in interface `TrackRendererPlugin.TrackRendererBuilder`
    Parameters:
      `type` - the content type
      `playerController` - the player controller
      `drmConfiguration` - the drm configuration
    Returns:
      the created track renderer container or null
    Throws:
      `CastlabsPlayerException` - in case of an error while preparing the renderer