Stay organized with collections
Save and categorize content based on your preferences.
DrmInitData
abstract class DrmInitData
Encapsulates initialization data required by a MediaDrm
instance.
Summary
Nested classes |
|
Scheme initialization data.
|
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,["# DrmInitData\n\nAdded in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nDrmInitData\n===========\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/media/DrmInitData \"View this page in Java\") \n\n```\nabstract class DrmInitData\n```\n\n|---|--------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.media.DrmInitData](#) |\n\nEncapsulates initialization data required by a [MediaDrm](/reference/kotlin/android/media/MediaDrm) instance.\n\nSummary\n-------\n\n| Nested classes ||\n|---|----------------------------------------------------------------------------------------------------------|\n| | [SchemeInitData](/reference/kotlin/android/media/DrmInitData.SchemeInitData) Scheme initialization data. |\n\n| Public methods ||\n|----------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract [DrmInitData.SchemeInitData](/reference/kotlin/android/media/DrmInitData.SchemeInitData)! | [get](#get(java.util.UUID))`(`schemeUuid:` `[UUID](../../java/util/UUID.html#)!`)` Retrieves initialization data for a given DRM scheme, specified by its UUID. |\n| open [DrmInitData.SchemeInitData](/reference/kotlin/android/media/DrmInitData.SchemeInitData) | [getSchemeInitDataAt](#getSchemeInitDataAt(kotlin.Int))`(`index:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Returns the [SchemeInitData](/reference/kotlin/android/media/DrmInitData.SchemeInitData) with the given `index`. |\n| open [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [getSchemeInitDataCount](#getSchemeInitDataCount())`()` Returns the number of [SchemeInitData](/reference/kotlin/android/media/DrmInitData.SchemeInitData) elements available through [getSchemeInitDataAt](#getSchemeInitDataAt(kotlin.Int)). |\n\nPublic methods\n--------------\n\n### get\n\nAdded in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \nDeprecated in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun get(schemeUuid: UUID!): DrmInitData.SchemeInitData!\n```\n\n**Deprecated:** *Use [getSchemeInitDataCount](#getSchemeInitDataCount()) and [getSchemeInitDataAt](#getSchemeInitDataAt(kotlin.Int)) instead.*\n\nRetrieves initialization data for a given DRM scheme, specified by its UUID.\n\n| Parameters ||\n|--------------|-------------------------------------------------------------|\n| `schemeUuid` | [UUID](../../java/util/UUID.html#)!: The DRM scheme's UUID. |\n\n| Return ||\n|-------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------|\n| [DrmInitData.SchemeInitData](/reference/kotlin/android/media/DrmInitData.SchemeInitData)! | The initialization data for the scheme, or null if the scheme is not supported. |\n\n### getSchemeInitDataAt\n\nAdded in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun getSchemeInitDataAt(index: Int): DrmInitData.SchemeInitData\n```\n\nReturns the [SchemeInitData](/reference/kotlin/android/media/DrmInitData.SchemeInitData) with the given `index`.\n\n| Parameters ||\n|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `index` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): The index of the [SchemeInitData](/reference/kotlin/android/media/DrmInitData.SchemeInitData) to return. |\n\n| Return ||\n|------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------|\n| [DrmInitData.SchemeInitData](/reference/kotlin/android/media/DrmInitData.SchemeInitData) | The [SchemeInitData](/reference/kotlin/android/media/DrmInitData.SchemeInitData) associated with the given `index`. This value cannot be `null`. |\n\n| Exceptions ||\n|---------------------------------------|------------------------------------------------------------------------------------------------------------|\n| `java.lang.IndexOutOfBoundsException` | If the given `index` is negative or greater than [getSchemeInitDataCount](#getSchemeInitDataCount())`- 1`. |\n\n### getSchemeInitDataCount\n\nAdded in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun getSchemeInitDataCount(): Int\n```\n\nReturns the number of [SchemeInitData](/reference/kotlin/android/media/DrmInitData.SchemeInitData) elements available through [getSchemeInitDataAt](#getSchemeInitDataAt(kotlin.Int))."]]