Stay organized with collections
Save and categorize content based on your preferences.
OnInfoListener
interface OnInfoListener
Interface definition of a callback to be invoked to communicate some info and/or warning about the media or its playback.
Summary
Public methods |
abstract Boolean |
Called to indicate an info or a warning.
|
Public methods
onInfo
abstract fun onInfo(
mp: MediaPlayer!,
what: Int,
extra: Int
): Boolean
Called to indicate an info or a warning.
Parameters |
mp |
MediaPlayer!: the MediaPlayer the info pertains to. |
what |
Int: the type of info or warning.
|
extra |
Int: an extra code, specific to the info. Typically implementation dependent. |
Return |
Boolean |
True if the method handled the info, false if it didn't. Returning false, or not having an OnInfoListener at all, will cause the info to be discarded. |
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,["# MediaPlayer.OnInfoListener\n\nAdded in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nOnInfoListener\n==============\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/media/MediaPlayer.OnInfoListener \"View this page in Java\") \n\n```\ninterface OnInfoListener\n```\n\n|-----------------------------------------------|\n| [android.media.MediaPlayer.OnInfoListener](#) |\n\nInterface definition of a callback to be invoked to communicate some info and/or warning about the media or its playback.\n\nSummary\n-------\n\n| Public methods ||\n|---------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [onInfo](#onInfo(android.media.MediaPlayer,%20kotlin.Int,%20kotlin.Int))`(`mp:` `[MediaPlayer](/reference/kotlin/android/media/MediaPlayer)!`, `what:` `[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)`)` Called to indicate an info or a warning. |\n\nPublic methods\n--------------\n\n### onInfo\n\nAdded in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun onInfo(\n mp: MediaPlayer!, \n what: Int, \n extra: Int\n): Boolean\n```\n\nCalled to indicate an info or a warning.\n\n| Parameters ||\n|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `mp` | [MediaPlayer](/reference/kotlin/android/media/MediaPlayer)!: the MediaPlayer the info pertains to. |\n| `what` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): the type of info or warning. - [MEDIA_INFO_UNKNOWN](/reference/kotlin/android/media/MediaPlayer#MEDIA_INFO_UNKNOWN:kotlin.Int) - [MEDIA_INFO_VIDEO_TRACK_LAGGING](/reference/kotlin/android/media/MediaPlayer#MEDIA_INFO_VIDEO_TRACK_LAGGING:kotlin.Int) - [MEDIA_INFO_VIDEO_RENDERING_START](/reference/kotlin/android/media/MediaPlayer#MEDIA_INFO_VIDEO_RENDERING_START:kotlin.Int) - [MEDIA_INFO_BUFFERING_START](/reference/kotlin/android/media/MediaPlayer#MEDIA_INFO_BUFFERING_START:kotlin.Int) - [MEDIA_INFO_BUFFERING_END](/reference/kotlin/android/media/MediaPlayer#MEDIA_INFO_BUFFERING_END:kotlin.Int) - `MEDIA_INFO_NETWORK_BANDWIDTH (703)` - bandwidth information is available (as `extra` kbps) - [MEDIA_INFO_BAD_INTERLEAVING](/reference/kotlin/android/media/MediaPlayer#MEDIA_INFO_BAD_INTERLEAVING:kotlin.Int) - [MEDIA_INFO_NOT_SEEKABLE](/reference/kotlin/android/media/MediaPlayer#MEDIA_INFO_NOT_SEEKABLE:kotlin.Int) - [MEDIA_INFO_METADATA_UPDATE](/reference/kotlin/android/media/MediaPlayer#MEDIA_INFO_METADATA_UPDATE:kotlin.Int) - [MEDIA_INFO_UNSUPPORTED_SUBTITLE](/reference/kotlin/android/media/MediaPlayer#MEDIA_INFO_UNSUPPORTED_SUBTITLE:kotlin.Int) - [MEDIA_INFO_SUBTITLE_TIMED_OUT](/reference/kotlin/android/media/MediaPlayer#MEDIA_INFO_SUBTITLE_TIMED_OUT:kotlin.Int) |\n| `extra` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): an extra code, specific to the info. Typically implementation dependent. |\n\n| Return ||\n|------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | True if the method handled the info, false if it didn't. Returning false, or not having an OnInfoListener at all, will cause the info to be discarded. |"]]