Interface DrmSession
-
- All Known Implementing Classes:
ErrorStateDrmSession
@Deprecated public interface DrmSession
Deprecated.com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.A DRM session.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classDrmSession.DrmSessionExceptionDeprecated.Wraps the throwable which is the cause of the error state.static interfaceDrmSession.StateDeprecated.The state of the DRM session.
-
Field Summary
Fields Modifier and Type Field Description static intSTATE_ERRORDeprecated.The session has encountered an error.static intSTATE_OPENEDDeprecated.The session is open, but does not have keys required for decryption.static intSTATE_OPENED_WITH_KEYSDeprecated.The session is open and has keys required for decryption.static intSTATE_OPENINGDeprecated.The session is being opened.static intSTATE_RELEASEDDeprecated.The session has been released.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description voidacquire(DrmSessionEventListener.EventDispatcher eventDispatcher)Deprecated.Increments the reference count.CryptoConfiggetCryptoConfig()Deprecated.Returns aCryptoConfigfor the open session, or null if called before the session has been opened or after it's been released.DrmSession.DrmSessionExceptiongetError()Deprecated.Returns the cause of the error state, or null ifgetState()is notSTATE_ERROR.byte[]getOfflineLicenseKeySetId()Deprecated.Returns the key set id of the offline license loaded into this session, or null if there isn't one.UUIDgetSchemeUuid()Deprecated.Returns the DRM scheme UUID for this session.@com.google.android.exoplayer2.drm.DrmSession.State intgetState()Deprecated.Returns the current state of the session, which is one ofSTATE_ERROR,STATE_RELEASED,STATE_OPENING,STATE_OPENEDandSTATE_OPENED_WITH_KEYS.default booleanplayClearSamplesWithoutKeys()Deprecated.Returns whether this session allows playback of clear samples prior to keys being loaded.Map<String,String>queryKeyStatus()Deprecated.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.voidrelease(DrmSessionEventListener.EventDispatcher eventDispatcher)Deprecated.Decrements the reference count.static voidreplaceSession(DrmSession previousSession, DrmSession newSession)Deprecated.AcquiresnewSessionthen releasespreviousSession.booleanrequiresSecureDecoder(String mimeType)Deprecated.Returns whether this session requires use of a secure decoder for the given MIME type.
-
-
-
Field Detail
-
STATE_RELEASED
static final int STATE_RELEASED
Deprecated.The session has been released. This is a terminal state.- See Also:
- Constant Field Values
-
STATE_ERROR
static final int STATE_ERROR
Deprecated.The session has encountered an error.getError()can be used to retrieve the cause. This is a terminal state.- See Also:
- Constant Field Values
-
STATE_OPENING
static final int STATE_OPENING
Deprecated.The session is being opened.- See Also:
- Constant Field Values
-
STATE_OPENED
static final int STATE_OPENED
Deprecated.The session is open, but does not have keys required for decryption.- See Also:
- Constant Field Values
-
STATE_OPENED_WITH_KEYS
static final int STATE_OPENED_WITH_KEYS
Deprecated.The session is open and has keys required for decryption.- See Also:
- Constant Field Values
-
-
Method Detail
-
replaceSession
static void replaceSession(@Nullable DrmSession previousSession, @Nullable DrmSession newSession)Deprecated.AcquiresnewSessionthen releasespreviousSession.Invokes
newSession'sacquire(DrmSessionEventListener.EventDispatcher)andpreviousSession'srelease(DrmSessionEventListener.EventDispatcher)in that order (passingeventDispatcher = null). Null arguments are ignored. Does nothing ifpreviousSessionandnewSessionare the same session.
-
getState
@State @com.google.android.exoplayer2.drm.DrmSession.State int getState()
Deprecated.Returns the current state of the session, which is one ofSTATE_ERROR,STATE_RELEASED,STATE_OPENING,STATE_OPENEDandSTATE_OPENED_WITH_KEYS.
-
playClearSamplesWithoutKeys
default boolean playClearSamplesWithoutKeys()
Deprecated.Returns whether this session allows playback of clear samples prior to keys being loaded.
-
getError
@Nullable DrmSession.DrmSessionException getError()
Deprecated.Returns the cause of the error state, or null ifgetState()is notSTATE_ERROR.
-
getSchemeUuid
UUID getSchemeUuid()
Deprecated.Returns the DRM scheme UUID for this session.
-
getCryptoConfig
@Nullable CryptoConfig getCryptoConfig()
Deprecated.Returns aCryptoConfigfor the open session, or null if called before the session has been opened or after it's been released.
-
queryKeyStatus
@Nullable Map<String,String> queryKeyStatus()
Deprecated.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:
- 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:
MediaDrm.queryKeyStatus(byte[])
-
getOfflineLicenseKeySetId
@Nullable byte[] getOfflineLicenseKeySetId()
Deprecated.Returns the key set id of the offline license loaded into this session, or null if there isn't one.
-
requiresSecureDecoder
boolean requiresSecureDecoder(String mimeType)
Deprecated.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_OPENEDorSTATE_OPENED_WITH_KEYS.
-
acquire
void acquire(@Nullable DrmSessionEventListener.EventDispatcher eventDispatcher)Deprecated.Increments the reference count. When the caller no longer needs to use the instance, it must callrelease(DrmSessionEventListener.EventDispatcher)to decrement the reference count.- Parameters:
eventDispatcher- TheDrmSessionEventListener.EventDispatcherused to route DRM-related events dispatched from this session, or null if no event handling is needed.
-
release
void release(@Nullable DrmSessionEventListener.EventDispatcher eventDispatcher)Deprecated.Decrements the reference count. If the reference count drops to 0 underlying resources are released, and the instance cannot be re-used.- Parameters:
eventDispatcher- TheDrmSessionEventListener.EventDispatcherto disconnect when the session is released (the same instance (possibly null) that was passed by the caller toacquire(DrmSessionEventListener.EventDispatcher)).
-
-