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 Deprecated Methods Modifier and Type Method Description MediaItem.DrmConfigurationbuild()MediaItem.DrmConfiguration.BuilderforceSessionsForAudioAndVideoTracks(boolean forceSessionsForAudioAndVideoTracks)Deprecated.UsesetForceSessionsForAudioAndVideoTracks(boolean)instead.MediaItem.DrmConfiguration.BuildersetForceDefaultLicenseUri(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.BuildersetForcedSessionTrackTypes(List<@TrackType Integer> forcedSessionTrackTypes)Sets a list oftrack typeconstants for which to use a DRM session even when the tracks are in the clear.MediaItem.DrmConfiguration.BuildersetForceSessionsForAudioAndVideoTracks(boolean forceSessionsForAudioAndVideoTracks)Sets whether a DRM session should be used for clear tracks of typeC.TRACK_TYPE_VIDEOandC.TRACK_TYPE_AUDIO.MediaItem.DrmConfiguration.BuildersetKeySetId(byte[] keySetId)Sets the key set ID of the offline license.MediaItem.DrmConfiguration.BuildersetLicenseRequestHeaders(Map<String,String> licenseRequestHeaders)Sets the optional request headers attached to DRM license requests.MediaItem.DrmConfiguration.BuildersetLicenseUri(Uri licenseUri)Sets the optional default DRM license server URI.MediaItem.DrmConfiguration.BuildersetLicenseUri(String licenseUri)Sets the optional default DRM license server URI.MediaItem.DrmConfiguration.BuildersetMultiSession(boolean multiSession)Sets whether multi session is enabled.MediaItem.DrmConfiguration.BuildersetPlayClearContentWithoutKey(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.BuildersetScheme(UUID scheme)Sets theUUIDof the protection scheme.
-
-
-
Method Detail
-
setScheme
@CanIgnoreReturnValue public MediaItem.DrmConfiguration.Builder setScheme(UUID scheme)
Sets theUUIDof the protection scheme.
-
setLicenseUri
@CanIgnoreReturnValue public MediaItem.DrmConfiguration.Builder setLicenseUri(@Nullable Uri licenseUri)
Sets the optional default DRM license server URI.
-
setLicenseUri
@CanIgnoreReturnValue public MediaItem.DrmConfiguration.Builder setLicenseUri(@Nullable String licenseUri)
Sets the optional default DRM license server URI.
-
setLicenseRequestHeaders
@CanIgnoreReturnValue public MediaItem.DrmConfiguration.Builder setLicenseRequestHeaders(Map<String,String> licenseRequestHeaders)
Sets the optional request headers attached to DRM license requests.
-
setMultiSession
@CanIgnoreReturnValue public MediaItem.DrmConfiguration.Builder setMultiSession(boolean multiSession)
Sets whether multi session is enabled.
-
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.
-
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.
-
forceSessionsForAudioAndVideoTracks
@CanIgnoreReturnValue @Deprecated @InlineMe(replacement="this.setForceSessionsForAudioAndVideoTracks(forceSessionsForAudioAndVideoTracks)") public MediaItem.DrmConfiguration.Builder forceSessionsForAudioAndVideoTracks(boolean forceSessionsForAudioAndVideoTracks)
Deprecated.UsesetForceSessionsForAudioAndVideoTracks(boolean)instead.
-
setForceSessionsForAudioAndVideoTracks
@CanIgnoreReturnValue public MediaItem.DrmConfiguration.Builder setForceSessionsForAudioAndVideoTracks(boolean forceSessionsForAudioAndVideoTracks)
Sets whether a DRM session should be used for clear tracks of typeC.TRACK_TYPE_VIDEOandC.TRACK_TYPE_AUDIO.This method overrides what has been set by previously calling
setForcedSessionTrackTypes(List).
-
setForcedSessionTrackTypes
@CanIgnoreReturnValue public MediaItem.DrmConfiguration.Builder setForcedSessionTrackTypes(List<@TrackType Integer> forcedSessionTrackTypes)
Sets a list oftrack typeconstants 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_VIDEOandC.TRACK_TYPE_AUDIO,setForceSessionsForAudioAndVideoTracks(boolean)can be used.This method overrides what has been set by previously calling
setForceSessionsForAudioAndVideoTracks(boolean).
-
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)).
-
build
public MediaItem.DrmConfiguration build()
-
-