Package com.castlabs.android.drm

# Class DrmConfiguration.Builder

java.lang.Object
com.castlabs.android.drm.DrmConfiguration.Builder

Enclosing class:
  `DrmConfiguration`

public static class DrmConfiguration.Builder extends Object
A builder implementation to create instances of `DrmConfiguration`s

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Builder()`
  Creates a new Builder with default values
  `Builder(DrmConfiguration drmConfiguration)`
  Creates a new Builder initialized with values from the given DrmConfiguration

- ## Method Summary

  Modifier and Type
  Method
  Description
  `DrmConfiguration.Builder`
  `audioDrm(Drm audioDrm)`
  Sets the DRM system to use for audio tracks
  `DrmConfiguration.Builder`
  `drm(Drm drm)`
  Sets the DRM system to use
  `DrmConfiguration.Builder`
  `forceWidevineL3(boolean forceWidevineL3)`
  Sets whether to force Widevine L3
  `DrmConfiguration`
  `get()`
  Builds and returns a new DrmConfiguration instance
  `DrmConfiguration.Builder`
  `keyRotation(boolean keyRotation)`
  Sets whether to enable key rotation on older devices
  `DrmConfiguration.Builder`
  `mediaDrmProperties(Bundle mediaDrmProperties)`
  Sets the MediaDrm properties
  `DrmConfiguration.Builder`
  `offlineId(String offlineId)`
  Sets the offline ID for this configuration
  `DrmConfiguration.Builder`
  `playClearSamplesWithoutKeys(boolean playClearSamplesWithoutKeys)`
  Sets whether clear samples should be played while fetching keys
  `DrmConfiguration.Builder`
  `preferManifestUrl(boolean preferManifestUrl)`
  Sets whether to prefer manifest URLs over the configured URL
  `DrmConfiguration.Builder`
  `renewalThresholdMs(long renewalThresholdMs)`
  Sets the license renewal threshold
  `DrmConfiguration.Builder`
  `requestParameters(Bundle requestParameters)`
  Sets additional request parameters for license requests
  `DrmConfiguration.Builder`
  `url(String url)`
  Sets the license server URL

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

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

- ## Constructor Details

  - ### Builder

    public Builder()
    Creates a new Builder with default values

  - ### Builder

    public Builder(@NonNull DrmConfiguration drmConfiguration)
    Creates a new Builder initialized with values from the given DrmConfiguration
    Parameters:
      `drmConfiguration` - The configuration to copy values from

- ## Method Details

  - ### url

    @NonNull public DrmConfiguration.Builder url(@Nullable String url)
    Sets the license server URL
    Parameters:
      `url` - The license server URL
    Returns:
      This builder

  - ### playClearSamplesWithoutKeys

    @NonNull public DrmConfiguration.Builder playClearSamplesWithoutKeys(boolean playClearSamplesWithoutKeys)
    Sets whether clear samples should be played while fetching keys
    Parameters:
      `playClearSamplesWithoutKeys` - True if clear samples should be played while fetching keys
    Returns:
      This builder

  - ### preferManifestUrl

    @NonNull public DrmConfiguration.Builder preferManifestUrl(boolean preferManifestUrl)
    Sets whether to prefer manifest URLs over the configured URL
    Parameters:
      `preferManifestUrl` - True if manifest URLs should be preferred
    Returns:
      This builder

  - ### offlineId

    @NonNull public DrmConfiguration.Builder offlineId(@Nullable String offlineId)
    Sets the offline ID for this configuration
    Parameters:
      `offlineId` - The offline ID
    Returns:
      This builder

  - ### drm

    @NonNull public DrmConfiguration.Builder drm(@Nullable Drm drm)
    Sets the DRM system to use
    Parameters:
      `drm` - The DRM system
    Returns:
      This builder

  - ### audioDrm

    @NonNull public DrmConfiguration.Builder audioDrm(@Nullable Drm audioDrm)
    Sets the DRM system to use for audio tracks
    Parameters:
      `audioDrm` - The DRM system for audio
    Returns:
      This builder

  - ### requestParameters

    @NonNull public DrmConfiguration.Builder requestParameters(@Nullable Bundle requestParameters)
    Sets additional request parameters for license requests
    Parameters:
      `requestParameters` - The request parameters bundle
    Returns:
      This builder

  - ### keyRotation

    @NonNull public DrmConfiguration.Builder keyRotation(boolean keyRotation)
    Sets whether to enable key rotation on older devices
    Parameters:
      `keyRotation` - True to enable key rotation
    Returns:
      This builder

  - ### forceWidevineL3

    @NonNull public DrmConfiguration.Builder forceWidevineL3(boolean forceWidevineL3)
    Sets whether to force Widevine L3
    Parameters:
      `forceWidevineL3` - True to force Widevine L3
    Returns:
      This builder

  - ### renewalThresholdMs

    @NonNull public DrmConfiguration.Builder renewalThresholdMs(long renewalThresholdMs)
    Sets the license renewal threshold
    Parameters:
      `renewalThresholdMs` - The renewal threshold in milliseconds
    Returns:
      This builder

  - ### mediaDrmProperties

    @NonNull public DrmConfiguration.Builder mediaDrmProperties(@Nullable Bundle mediaDrmProperties)
    Sets the MediaDrm properties
    Parameters:
      `mediaDrmProperties` - The MediaDrm properties bundle
    Returns:
      This builder

  - ### get

    @NonNull public DrmConfiguration get()
    Builds and returns a new DrmConfiguration instance
    Returns:
      A new DrmConfiguration instance