Stay organized with collections
Save and categorize content based on your preferences.
OnEventListener
interface OnEventListener
Interface definition for a callback to be invoked when a drm event occurs
Summary
Public methods |
abstract Unit |
Called when an event occurs that requires the app to be notified
|
Public methods
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# MediaDrm.OnEventListener\n\nAdded in [API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nOnEventListener\n===============\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/media/MediaDrm.OnEventListener \"View this page in Java\") \n\n```\ninterface OnEventListener\n```\n\n|---------------------------------------------|\n| [android.media.MediaDrm.OnEventListener](#) |\n\nInterface definition for a callback to be invoked when a drm event occurs\n\nSummary\n-------\n\n| Public methods ||\n|---------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onEvent](#onEvent(android.media.MediaDrm,%20kotlin.ByteArray,%20kotlin.Int,%20kotlin.Int,%20kotlin.ByteArray))`(`md:` `[MediaDrm](/reference/kotlin/android/media/MediaDrm)`, `sessionId:` `[ByteArray](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-byte-array/index.html)?`, `event:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `extra:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `data:` `[ByteArray](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-byte-array/index.html)?`)` Called when an event occurs that requires the app to be notified |\n\nPublic methods\n--------------\n\n### onEvent\n\nAdded in [API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun onEvent(\n md: MediaDrm, \n sessionId: ByteArray?, \n event: Int, \n extra: Int, \n data: ByteArray?\n): Unit\n```\n\nCalled when an event occurs that requires the app to be notified\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, or `null` if there is no session ID associated with the event. |\n| `event` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): indicates the event type Value is [android.media.MediaDrm#EVENT_PROVISION_REQUIRED](/reference/kotlin/android/media/MediaDrm#EVENT_PROVISION_REQUIRED:kotlin.Int), [android.media.MediaDrm#EVENT_KEY_REQUIRED](/reference/kotlin/android/media/MediaDrm#EVENT_KEY_REQUIRED:kotlin.Int), [android.media.MediaDrm#EVENT_KEY_EXPIRED](/reference/kotlin/android/media/MediaDrm#EVENT_KEY_EXPIRED:kotlin.Int), [android.media.MediaDrm#EVENT_VENDOR_DEFINED](/reference/kotlin/android/media/MediaDrm#EVENT_VENDOR_DEFINED:kotlin.Int), or [android.media.MediaDrm#EVENT_SESSION_RECLAIMED](/reference/kotlin/android/media/MediaDrm#EVENT_SESSION_RECLAIMED:kotlin.Int) |\n| `extra` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): an secondary error code |\n| `data` | [ByteArray](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-byte-array/index.html)?: optional byte array of data that may be associated with the event This value may be `null`. |"]]