ErrorStateDrmSession


@UnstableApi
class ErrorStateDrmSession : DrmSession


A DrmSession that's in a terminal error state.

Summary

Public functions

Unit

Increments the reference count.

CryptoConfig?

Returns a CryptoConfig for the open session, or null if called before the session has been opened or after it's been released.

ByteArray<Byte>?

Returns the key set id of the offline license loaded into this session, or null if there isn't one.

UUID!

Returns the DRM scheme UUID for this session.

Int

Returns the current state of the session, which is one of STATE_ERROR, STATE_RELEASED, STATE_OPENING, STATE_OPENED and STATE_OPENED_WITH_KEYS.

Boolean

Returns whether this session allows playback of clear samples prior to keys being loaded.

(Mutable)Map<String!, String!>?

Returns a map describing the key status for the session, or null if called before the session has been opened or after it's been released.

Unit

Decrements the reference count.

Boolean

Returns whether this session requires use of a secure decoder for the given MIME type.

Inherited Constants

From androidx.media3.exoplayer.drm.DrmSession
const Int

The session has encountered an error.

const Int

The session is open, but does not have keys required for decryption.

const Int

The session is open and has keys required for decryption.

const Int

The session is being opened.

const Int

The session has been released.

Inherited functions

From androidx.media3.exoplayer.drm.DrmSession
java-static Unit
replaceSession(previousSession: DrmSession?, newSession: DrmSession?)

Acquires newSession then releases previousSession.

Public constructors

ErrorStateDrmSession

ErrorStateDrmSession(error: DrmSession.DrmSessionException!)

Public functions

acquire

fun acquire(eventDispatcher: DrmSessionEventListener.EventDispatcher?): Unit

Increments the reference count. When the caller no longer needs to use the instance, it must call release to decrement the reference count.

Parameters
eventDispatcher: DrmSessionEventListener.EventDispatcher?

The DrmSessionEventListener.EventDispatcher used to route DRM-related events dispatched from this session, or null if no event handling is needed.

getCryptoConfig

fun getCryptoConfig(): CryptoConfig?

Returns a CryptoConfig for the open session, or null if called before the session has been opened or after it's been released.

getOfflineLicenseKeySetId

fun getOfflineLicenseKeySetId(): ByteArray<Byte>?

Returns the key set id of the offline license loaded into this session, or null if there isn't one.

getSchemeUuid

fun getSchemeUuid(): UUID!

Returns the DRM scheme UUID for this session.

getState

fun getState(): Int

Returns the current state of the session, which is one of STATE_ERROR, STATE_RELEASED, STATE_OPENING, STATE_OPENED and STATE_OPENED_WITH_KEYS.

playClearSamplesWithoutKeys

fun playClearSamplesWithoutKeys(): Boolean

Returns whether this session allows playback of clear samples prior to keys being loaded.

queryKeyStatus

fun queryKeyStatus(): (Mutable)Map<String!, String!>?

Returns a map describing the key status for the session, or null if called before the session has been opened or after it's been released.

Since DRM license policies vary by vendor, the specific status field names are determined by each DRM vendor. Refer to your DRM provider documentation for definitions of the field names for a particular DRM engine plugin.

Returns
(Mutable)Map<String!, String!>?

A map describing the key status for the session, or null if called before the session has been opened or after it's been released.

See also
queryKeyStatus

release

fun release(eventDispatcher: DrmSessionEventListener.EventDispatcher?): Unit

Decrements the reference count. If the reference count drops to 0 underlying resources are released, and the instance cannot be re-used.

Parameters
eventDispatcher: DrmSessionEventListener.EventDispatcher?

The DrmSessionEventListener.EventDispatcher to disconnect when the session is released (the same instance (possibly null) that was passed by the caller to acquire).

requiresSecureDecoder

fun requiresSecureDecoder(mimeType: String!): Boolean

Returns whether this session requires use of a secure decoder for the given MIME type. Assumes a license policy that requires the highest level of security supported by the session.

The session must be in stateSTATE_OPENED or STATE_OPENED_WITH_KEYS.

Public properties