Class DrmLicenseLoader.Builder

java.lang.Object
com.castlabs.android.player.DrmLicenseLoader.Builder
Enclosing class:
DrmLicenseLoader

public static class DrmLicenseLoader.Builder extends Object
Use this builder class to generate new instances of the DrmLicenseLoader.
  • Constructor Details

  • Method Details

    • contentType

      @NonNull public DrmLicenseLoader.Builder contentType(int contentType)
      Parameters:
      contentType - The content type
      Returns:
      The builder
    • mergeVideoTracks

      @NonNull public DrmLicenseLoader.Builder mergeVideoTracks(boolean mergeVideoTracks)
      Explicitly set the merge video tracks flag.
      Parameters:
      mergeVideoTracks - The merge video tracks flag
      Returns:
      The builder
    • dataSourceFactory

      @NonNull public DrmLicenseLoader.Builder dataSourceFactory(@Nullable DataSourceFactory dataSourceFactory)
      Set the data source factory that is used to generate content requests. Note that this will reset any query and request parameters.
      Parameters:
      dataSourceFactory - The data source factory
      Returns:
      The builder
    • queryParameter

      @NonNull public DrmLicenseLoader.Builder queryParameter(@NonNull String key, @NonNull String value)
      Add a query parameter to each content data request
      Parameters:
      key - the key
      value - the value
      Returns:
      The builder
    • headerParameter

      @NonNull public DrmLicenseLoader.Builder headerParameter(@NonNull String key, @NonNull String value)
      Add a header parameter to each content data request
      Parameters:
      key - the key
      value - the value
      Returns:
      The builder
    • manifestModifier

      @NonNull public DrmLicenseLoader.Builder manifestModifier(@Nullable ManifestModifier manifestModifier)
      Add a ManifestModifier to optionally trim tracks out of it. In the offline use case, non-downloaded tracks need to be removed from the Manifest, so the loader will properly fetch one of the downloaded tracks in order to acquire the PSSH data.
      Parameters:
      manifestModifier - the modifier
      Returns:
      The Builder
    • sourceSelectorFactory

      @NonNull public DrmLicenseLoader.Builder sourceSelectorFactory(@Nullable com.google.android.exoplayer2.upstream.InternalSourceSelector.Factory sourceSelectorFactory)
      Set the source selector factory that is used to pick up a base url from the manifest
      Parameters:
      sourceSelectorFactory - The source selector factory
      Returns:
      The builder
    • get

      Creates the license loader.
      Returns:
      The license loader
      Throws:
      IllegalArgumentException - in case no plugin was found that can handle the content or no offline ID is specified in the DRM configuration
      NullPointerException - if mandatory data are not specified