Stay organized with collections
Save and categorize content based on your preferences.
OnKeyStatusChangeListener
interface OnKeyStatusChangeListener
Interface definition for a callback to be invoked when the keys in a drm session change states.
Summary
Public methods |
abstract Unit |
Called when the keys in a session change status, such as when the license is renewed or expires.
|
Public methods
onKeyStatusChange
abstract fun onKeyStatusChange(
md: MediaDrm,
sessionId: ByteArray,
keyInformation: MutableList<MediaDrm.KeyStatus!>,
hasNewUsableKey: Boolean
): Unit
Called when the keys in a session change status, such as when the license is renewed or expires.
Parameters |
md |
MediaDrm: the MediaDrm object on which the event occurred This value cannot be null . |
sessionId |
ByteArray: the DRM session ID on which the event occurred This value cannot be null . |
keyInformation |
MutableList<MediaDrm.KeyStatus!>: a list of MediaDrm.KeyStatus instances indicating the status for each key in the session This value cannot be null . |
hasNewUsableKey |
Boolean: indicates if a key has been added that is usable, which may trigger an attempt to resume playback on the media stream if it is currently blocked waiting for a key. |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# MediaDrm.OnKeyStatusChangeListener\n\nAdded in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nOnKeyStatusChangeListener\n=========================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/media/MediaDrm.OnKeyStatusChangeListener \"View this page in Java\") \n\n```\ninterface OnKeyStatusChangeListener\n```\n\n|-------------------------------------------------------|\n| [android.media.MediaDrm.OnKeyStatusChangeListener](#) |\n\nInterface definition for a callback to be invoked when the keys in a drm session change states.\n\nSummary\n-------\n\n| Public methods ||\n|---------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onKeyStatusChange](#onKeyStatusChange(android.media.MediaDrm,%20kotlin.ByteArray,%20kotlin.collections.MutableList,%20kotlin.Boolean))`(`md:` `[MediaDrm](/reference/kotlin/android/media/MediaDrm)`, `sessionId:` `[ByteArray](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-byte-array/index.html)`, `keyInformation:` `[MutableList](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)\u003c[MediaDrm.KeyStatus](/reference/kotlin/android/media/MediaDrm.KeyStatus)!\u003e`, `hasNewUsableKey:` `[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)` Called when the keys in a session change status, such as when the license is renewed or expires. |\n\nPublic methods\n--------------\n\n### onKeyStatusChange\n\nAdded in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun onKeyStatusChange(\n md: MediaDrm, \n sessionId: ByteArray, \n keyInformation: MutableList\u003cMediaDrm.KeyStatus!\u003e, \n hasNewUsableKey: Boolean\n): Unit\n```\n\nCalled when the keys in a session change status, such as when the license is renewed or expires.\n\n| Parameters ||\n|-------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `md` | [MediaDrm](/reference/kotlin/android/media/MediaDrm): the MediaDrm object on which the event occurred This value cannot be `null`. |\n| `sessionId` | [ByteArray](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-byte-array/index.html): the DRM session ID on which the event occurred This value cannot be `null`. |\n| `keyInformation` | [MutableList](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)\\\u003c[MediaDrm.KeyStatus](/reference/kotlin/android/media/MediaDrm.KeyStatus)!\\\u003e: a list of [MediaDrm.KeyStatus](/reference/kotlin/android/media/MediaDrm.KeyStatus) instances indicating the status for each key in the session This value cannot be `null`. |\n| `hasNewUsableKey` | [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html): indicates if a key has been added that is usable, which may trigger an attempt to resume playback on the media stream if it is currently blocked waiting for a key. |"]]