Interface DrmSession

    • Field Detail

      • STATE_RELEASED

        static final int STATE_RELEASED
        The session has been released. This is a terminal state.
        See Also:
        Constant Field Values
      • STATE_ERROR

        static final int STATE_ERROR
        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
        The session is being opened.
        See Also:
        Constant Field Values
      • STATE_OPENED

        static final int STATE_OPENED
        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
        The session is open and has keys required for decryption.
        See Also:
        Constant Field Values
    • Method Detail

      • playClearSamplesWithoutKeys

        default boolean playClearSamplesWithoutKeys()
        Returns whether this session allows playback of clear samples prior to keys being loaded.
      • getSchemeUuid

        UUID getSchemeUuid()
        Returns the DRM scheme UUID for this session.
      • getCryptoConfig

        @Nullable
        CryptoConfig getCryptoConfig()
        Returns a CryptoConfig for 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()
        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()
        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)
        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 state STATE_OPENED or STATE_OPENED_WITH_KEYS.