public interface DrmSession<T extends ExoMediaCrypto>
Modifier and Type | Interface and Description |
---|---|
static interface |
DrmSession.State
The state of the DRM session.
|
Modifier and Type | Field and Description |
---|---|
static int |
STATE_CLOSED
The session is closed.
|
static int |
STATE_ERROR
The session has encountered an error.
|
static int |
STATE_OPENED
The session is open, but does not yet have the keys required for decryption.
|
static int |
STATE_OPENED_WITH_KEYS
The session is open and has the keys required for decryption.
|
static int |
STATE_OPENING
The session is being opened.
|
Modifier and Type | Method and Description |
---|---|
Exception |
getError()
Returns the cause of the error state.
|
T |
getMediaCrypto()
Returns a
ExoMediaCrypto for the open session. |
int |
getState()
Returns the current state of the session.
|
boolean |
requiresSecureDecoderComponent(String mimeType)
Whether the session requires a secure decoder for the specified mime type.
|
static final int STATE_ERROR
getError()
can be used to retrieve the cause.static final int STATE_CLOSED
static final int STATE_OPENING
static final int STATE_OPENED
static final int STATE_OPENED_WITH_KEYS
int getState()
STATE_ERROR
, STATE_CLOSED
, STATE_OPENING
,
STATE_OPENED
and STATE_OPENED_WITH_KEYS
.T getMediaCrypto()
ExoMediaCrypto
for the open session.
This method may be called when the session is in the following states:
STATE_OPENED
, STATE_OPENED_WITH_KEYS
ExoMediaCrypto
for the open session.IllegalStateException
- If called when a session isn't opened.boolean requiresSecureDecoderComponent(String mimeType)
Normally this method should return
ExoMediaCrypto.requiresSecureDecoderComponent(String)
, however in some cases
implementations may wish to modify the return value (i.e. to force a secure decoder even when
one is not required).
This method may be called when the session is in the following states:
STATE_OPENED
, STATE_OPENED_WITH_KEYS
IllegalStateException
- If called when a session isn't opened.Exception getError()
This method may be called when the session is in any state.
STATE_ERROR
. Null otherwise.