MediaItem.DrmConfiguration.Builder
public final class MediaItem.DrmConfiguration.Builder
Builder for DrmConfiguration.
Summary
Public methods |
|
|---|---|
MediaItem.DrmConfiguration |
build() |
MediaItem.DrmConfiguration.Builder |
@CanIgnoreReturnValueThis method is deprecated. Use |
MediaItem.DrmConfiguration.Builder |
@CanIgnoreReturnValueSets whether to always use the default DRM license server URI even if the media specifies its own DRM license server URI. |
MediaItem.DrmConfiguration.Builder |
@CanIgnoreReturnValueSets whether a DRM session should be used for clear tracks of type |
MediaItem.DrmConfiguration.Builder |
@CanIgnoreReturnValueSets a list of |
MediaItem.DrmConfiguration.Builder |
@CanIgnoreReturnValueSets the key set ID of the offline license. |
MediaItem.DrmConfiguration.Builder |
@CanIgnoreReturnValueSets the optional request headers attached to DRM license requests. |
MediaItem.DrmConfiguration.Builder |
@CanIgnoreReturnValueSets the optional default DRM license server URI. |
MediaItem.DrmConfiguration.Builder |
@CanIgnoreReturnValueSets the optional default DRM license server URI. |
MediaItem.DrmConfiguration.Builder |
@CanIgnoreReturnValueSets whether multi session is enabled. |
MediaItem.DrmConfiguration.Builder |
@CanIgnoreReturnValueSets whether clear samples within protected content should be played when keys for the encrypted part of the content have yet to be loaded. |
MediaItem.DrmConfiguration.Builder |
@CanIgnoreReturnValueSets the |
Public constructors
Public methods
forceSessionsForAudioAndVideoTracks
@CanIgnoreReturnValue
@UnstableApi
@InlineMe(replacement = "this.setForceSessionsForAudioAndVideoTracks(forceSessionsForAudioAndVideoTracks)")
public MediaItem.DrmConfiguration.BuilderforceSessionsForAudioAndVideoTracks(
boolean forceSessionsForAudioAndVideoTracks
)
setForceDefaultLicenseUri
@CanIgnoreReturnValue
public MediaItem.DrmConfiguration.Builder setForceDefaultLicenseUri(boolean forceDefaultLicenseUri)
Sets whether to always use the default DRM license server URI even if the media specifies its own DRM license server URI.
The default is false.
setForceSessionsForAudioAndVideoTracks
@CanIgnoreReturnValue
public MediaItem.DrmConfiguration.Builder setForceSessionsForAudioAndVideoTracks(
boolean forceSessionsForAudioAndVideoTracks
)
Sets whether a DRM session should be used for clear tracks of type TRACK_TYPE_VIDEO and TRACK_TYPE_AUDIO.
This method overrides what has been set by previously calling setForcedSessionTrackTypes.
The default is false.
setForcedSessionTrackTypes
@CanIgnoreReturnValue
public MediaItem.DrmConfiguration.Builder setForcedSessionTrackTypes(
List<@C.TrackType Integer> forcedSessionTrackTypes
)
Sets a list of track type constants for which to use a DRM session even when the tracks are in the clear.
For the common case of using a DRM session for TRACK_TYPE_VIDEO and TRACK_TYPE_AUDIO, setForceSessionsForAudioAndVideoTracks can be used.
This method overrides what has been set by previously calling setForceSessionsForAudioAndVideoTracks.
The default is an empty list (i.e. DRM sessions are not forced for any track type).
setKeySetId
@CanIgnoreReturnValue
public MediaItem.DrmConfiguration.Builder setKeySetId(@Nullable byte[] keySetId)
Sets the key set ID of the offline license.
The key set ID identifies an offline license. The ID is required to query, renew or release an existing offline license (see DefaultDrmSessionManager#setMode(int
mode,byte[] offlineLicenseKeySetId)).
setLicenseRequestHeaders
@CanIgnoreReturnValue
public MediaItem.DrmConfiguration.Builder setLicenseRequestHeaders(Map<String, String> licenseRequestHeaders)
Sets the optional request headers attached to DRM license requests.
setLicenseUri
@CanIgnoreReturnValue
public MediaItem.DrmConfiguration.Builder setLicenseUri(@Nullable String licenseUri)
Sets the optional default DRM license server URI.
setLicenseUri
@CanIgnoreReturnValue
public MediaItem.DrmConfiguration.Builder setLicenseUri(@Nullable Uri licenseUri)
Sets the optional default DRM license server URI.
setMultiSession
@CanIgnoreReturnValue
public MediaItem.DrmConfiguration.Builder setMultiSession(boolean multiSession)
Sets whether multi session is enabled.
The default is false (multi session disabled).
setPlayClearContentWithoutKey
@CanIgnoreReturnValue
public MediaItem.DrmConfiguration.Builder setPlayClearContentWithoutKey(boolean playClearContentWithoutKey)
Sets whether clear samples within protected content should be played when keys for the encrypted part of the content have yet to be loaded.
The default is true.
setScheme
@CanIgnoreReturnValue
public MediaItem.DrmConfiguration.Builder setScheme(UUID scheme)
Sets the UUID of the protection scheme.