MediaItem.DrmConfiguration.Builder


class MediaItem.DrmConfiguration.Builder


Builder for DrmConfiguration.

Summary

Public constructors

Builder(scheme: UUID!)

Constructs an instance.

Public functions

MediaItem.DrmConfiguration!
MediaItem.DrmConfiguration.Builder!
@CanIgnoreReturnValue
@UnstableApi
@InlineMe(replacement = "this.setForceSessionsForAudioAndVideoTracks(forceSessionsForAudioAndVideoTracks)")
forceSessionsForAudioAndVideoTracks(
    forceSessionsForAudioAndVideoTracks: Boolean
)

This function is deprecated.

Use setForceSessionsForAudioAndVideoTracks instead.

MediaItem.DrmConfiguration.Builder!

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!
@CanIgnoreReturnValue
setForceSessionsForAudioAndVideoTracks(
    forceSessionsForAudioAndVideoTracks: Boolean
)

Sets whether a DRM session should be used for clear tracks of type TRACK_TYPE_VIDEO and TRACK_TYPE_AUDIO.

MediaItem.DrmConfiguration.Builder!

Sets a list of track type constants for which to use a DRM session even when the tracks are in the clear.

MediaItem.DrmConfiguration.Builder!

Sets the key set ID of the offline license.

MediaItem.DrmConfiguration.Builder!
@CanIgnoreReturnValue
setLicenseRequestHeaders(
    licenseRequestHeaders: (Mutable)Map<String!, String!>!
)

Sets the optional request headers attached to DRM license requests.

MediaItem.DrmConfiguration.Builder!

Sets the optional default DRM license server URI.

MediaItem.DrmConfiguration.Builder!

Sets the optional default DRM license server URI.

MediaItem.DrmConfiguration.Builder!

Sets whether multi session is enabled.

MediaItem.DrmConfiguration.Builder!

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!

Sets the UUID of the protection scheme.

Public constructors

Builder

Builder(scheme: UUID!)

Constructs an instance.

Parameters
scheme: UUID!

The UUID of the protection scheme.

Public functions

forceSessionsForAudioAndVideoTracks

@CanIgnoreReturnValue
@UnstableApi
@InlineMe(replacement = "this.setForceSessionsForAudioAndVideoTracks(forceSessionsForAudioAndVideoTracks)")
fun forceSessionsForAudioAndVideoTracks(
    forceSessionsForAudioAndVideoTracks: Boolean
): MediaItem.DrmConfiguration.Builder!

setForceDefaultLicenseUri

@CanIgnoreReturnValue
fun setForceDefaultLicenseUri(forceDefaultLicenseUri: Boolean): MediaItem.DrmConfiguration.Builder!

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
fun setForceSessionsForAudioAndVideoTracks(
    forceSessionsForAudioAndVideoTracks: Boolean
): MediaItem.DrmConfiguration.Builder!

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
fun setForcedSessionTrackTypes(
    forcedSessionTrackTypes: (Mutable)List<@C.TrackType Int!>!
): MediaItem.DrmConfiguration.Builder!

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
fun setKeySetId(keySetId: ByteArray?): MediaItem.DrmConfiguration.Builder!

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
fun setLicenseRequestHeaders(
    licenseRequestHeaders: (Mutable)Map<String!, String!>!
): MediaItem.DrmConfiguration.Builder!

Sets the optional request headers attached to DRM license requests.

setLicenseUri

@CanIgnoreReturnValue
fun setLicenseUri(licenseUri: String?): MediaItem.DrmConfiguration.Builder!

Sets the optional default DRM license server URI.

setLicenseUri

@CanIgnoreReturnValue
fun setLicenseUri(licenseUri: Uri?): MediaItem.DrmConfiguration.Builder!

Sets the optional default DRM license server URI.

setMultiSession

@CanIgnoreReturnValue
fun setMultiSession(multiSession: Boolean): MediaItem.DrmConfiguration.Builder!

Sets whether multi session is enabled.

The default is false (multi session disabled).

setPlayClearContentWithoutKey

@CanIgnoreReturnValue
fun setPlayClearContentWithoutKey(playClearContentWithoutKey: Boolean): MediaItem.DrmConfiguration.Builder!

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
fun setScheme(scheme: UUID!): MediaItem.DrmConfiguration.Builder!

Sets the UUID of the protection scheme.