Package com.castlabs.android.drm
Class DrmConfiguration.Builder
java.lang.Object
com.castlabs.android.drm.DrmConfiguration.Builder
- Enclosing class:
DrmConfiguration
A builder implementation to create instances of
DrmConfigurations-
Constructor Summary
ConstructorsConstructorDescriptionBuilder()Creates a new Builder with default valuesBuilder(DrmConfiguration drmConfiguration) Creates a new Builder initialized with values from the given DrmConfiguration -
Method Summary
Modifier and TypeMethodDescriptionSets the DRM system to use for audio tracksSets the DRM system to useforceWidevineL3(boolean forceWidevineL3) Sets whether to force Widevine L3get()Builds and returns a new DrmConfiguration instancekeyRotation(boolean keyRotation) Sets whether to enable key rotation on older devicesmediaDrmProperties(Bundle mediaDrmProperties) Sets the MediaDrm propertiesSets the offline ID for this configurationplayClearSamplesWithoutKeys(boolean playClearSamplesWithoutKeys) Sets whether clear samples should be played while fetching keyspreferManifestUrl(boolean preferManifestUrl) Sets whether to prefer manifest URLs over the configured URLrenewalThresholdMs(long renewalThresholdMs) Sets the license renewal thresholdrequestParameters(Bundle requestParameters) Sets additional request parameters for license requestsSets the license server URL
-
Constructor Details
-
Builder
public Builder()Creates a new Builder with default values -
Builder
Creates a new Builder initialized with values from the given DrmConfiguration- Parameters:
drmConfiguration- The configuration to copy values from
-
-
Method Details
-
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
Sets whether to prefer manifest URLs over the configured URL- Parameters:
preferManifestUrl- True if manifest URLs should be preferred- Returns:
- This builder
-
offlineId
Sets the offline ID for this configuration- Parameters:
offlineId- The offline ID- Returns:
- This builder
-
drm
Sets the DRM system to use- Parameters:
drm- The DRM system- Returns:
- This builder
-
audioDrm
Sets the DRM system to use for audio tracks- Parameters:
audioDrm- The DRM system for audio- Returns:
- This builder
-
requestParameters
Sets additional request parameters for license requests- Parameters:
requestParameters- The request parameters bundle- Returns:
- This builder
-
keyRotation
Sets whether to enable key rotation on older devices- Parameters:
keyRotation- True to enable key rotation- Returns:
- This builder
-
forceWidevineL3
Sets whether to force Widevine L3- Parameters:
forceWidevineL3- True to force Widevine L3- Returns:
- This builder
-
renewalThresholdMs
Sets the license renewal threshold- Parameters:
renewalThresholdMs- The renewal threshold in milliseconds- Returns:
- This builder
-
mediaDrmProperties
Sets the MediaDrm properties- Parameters:
mediaDrmProperties- The MediaDrm properties bundle- Returns:
- This builder
-
get
Builds and returns a new DrmConfiguration instance- Returns:
- A new DrmConfiguration instance
-