Package com.google.android.exoplayer2
Class MediaItem.DrmConfiguration.Builder
- java.lang.Object
-
- com.google.android.exoplayer2.MediaItem.DrmConfiguration.Builder
-
- Enclosing class:
- MediaItem.DrmConfiguration
public static final class MediaItem.DrmConfiguration.Builder extends Object
Builder forMediaItem.DrmConfiguration
.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MediaItem.DrmConfiguration
build()
MediaItem.DrmConfiguration.Builder
forceSessionsForAudioAndVideoTracks(boolean useClearSessionsForAudioAndVideoTracks)
Sets whether a DRM session should be used for clear tracks of typeC.TRACK_TYPE_VIDEO
andC.TRACK_TYPE_AUDIO
.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.MediaItem.DrmConfiguration.Builder
setForcedSessionTrackTypes(List<@TrackType Integer> forcedSessionTrackTypes)
Sets a list oftrack type
constants for which to use a DRM session even when the tracks are in the clear.MediaItem.DrmConfiguration.Builder
setKeySetId(byte[] keySetId)
Sets the key set ID of the offline license.MediaItem.DrmConfiguration.Builder
setLicenseRequestHeaders(Map<String,String> licenseRequestHeaders)
Sets the optional request headers attached to DRM license requests.MediaItem.DrmConfiguration.Builder
setLicenseUri(Uri licenseUri)
Sets the optional default DRM license server URI.MediaItem.DrmConfiguration.Builder
setLicenseUri(String licenseUri)
Sets the optional default DRM license server URI.MediaItem.DrmConfiguration.Builder
setMultiSession(boolean multiSession)
Sets whether multi session is enabled.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.MediaItem.DrmConfiguration.Builder
setScheme(UUID scheme)
Sets theUUID
of the protection scheme.
-
-
-
Method Detail
-
setScheme
public MediaItem.DrmConfiguration.Builder setScheme(UUID scheme)
Sets theUUID
of the protection scheme.
-
setLicenseUri
public MediaItem.DrmConfiguration.Builder setLicenseUri(@Nullable Uri licenseUri)
Sets the optional default DRM license server URI.
-
setLicenseUri
public MediaItem.DrmConfiguration.Builder setLicenseUri(@Nullable String licenseUri)
Sets the optional default DRM license server URI.
-
setLicenseRequestHeaders
public MediaItem.DrmConfiguration.Builder setLicenseRequestHeaders(Map<String,String> licenseRequestHeaders)
Sets the optional request headers attached to DRM license requests.
-
setMultiSession
public MediaItem.DrmConfiguration.Builder setMultiSession(boolean multiSession)
Sets whether multi session is enabled.
-
setForceDefaultLicenseUri
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.
-
setPlayClearContentWithoutKey
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.
-
forceSessionsForAudioAndVideoTracks
public MediaItem.DrmConfiguration.Builder forceSessionsForAudioAndVideoTracks(boolean useClearSessionsForAudioAndVideoTracks)
Sets whether a DRM session should be used for clear tracks of typeC.TRACK_TYPE_VIDEO
andC.TRACK_TYPE_AUDIO
.This method overrides what has been set by previously calling
setForcedSessionTrackTypes(List)
.
-
setForcedSessionTrackTypes
public MediaItem.DrmConfiguration.Builder setForcedSessionTrackTypes(List<@TrackType Integer> forcedSessionTrackTypes)
Sets a list oftrack 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
C.TRACK_TYPE_VIDEO
andC.TRACK_TYPE_AUDIO
,forceSessionsForAudioAndVideoTracks(boolean)
can be used.This method overrides what has been set by previously calling
forceSessionsForAudioAndVideoTracks(boolean)
.
-
setKeySetId
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)
).
-
build
public MediaItem.DrmConfiguration build()
-
-