Stay organized with collections
Save and categorize content based on your preferences.
public
static
interface
MediaPlayer.OnInfoListener
android.media.MediaPlayer.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
|
onInfo(MediaPlayer mp, int what, int extra)
Called to indicate an info or a warning.
|
Public methods
public abstract boolean onInfo (MediaPlayer mp,
int what,
int extra)
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. |
Returns |
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](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\nMediaPlayer.OnInfoListener\n==========================\n\n*** ** * ** ***\n\n[Kotlin](/reference/kotlin/android/media/MediaPlayer.OnInfoListener \"View this page in Kotlin\") \\|Java\n\n\n`\npublic\nstatic\n\n\ninterface\nMediaPlayer.OnInfoListener\n`\n\n\n`\n\n\n`\n\n|------------------------------------------|\n| android.media.MediaPlayer.OnInfoListener |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nInterface definition of a callback to be invoked to communicate some\ninfo and/or warning about the media or its playback.\n\nSummary\n-------\n\n| ### Public methods ||\n|---------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract boolean` | ` `[onInfo](/reference/android/media/MediaPlayer.OnInfoListener#onInfo(android.media.MediaPlayer,%20int,%20int))`(`[MediaPlayer](/reference/android/media/MediaPlayer)` mp, int what, int extra) ` Called to indicate an info or a warning. |\n\nPublic methods\n--------------\n\n### onInfo\n\nAdded in [API level 3](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract boolean onInfo (MediaPlayer mp, \n int what, \n int extra)\n```\n\nCalled to indicate an info or a warning.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|---------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `mp` | `MediaPlayer`: the MediaPlayer the info pertains to. \u003cbr /\u003e |\n| `what` | `int`: the type of info or warning. - [MediaPlayer.MEDIA_INFO_UNKNOWN](/reference/android/media/MediaPlayer#MEDIA_INFO_UNKNOWN) - [MediaPlayer.MEDIA_INFO_VIDEO_TRACK_LAGGING](/reference/android/media/MediaPlayer#MEDIA_INFO_VIDEO_TRACK_LAGGING) - [MediaPlayer.MEDIA_INFO_VIDEO_RENDERING_START](/reference/android/media/MediaPlayer#MEDIA_INFO_VIDEO_RENDERING_START) - [MediaPlayer.MEDIA_INFO_BUFFERING_START](/reference/android/media/MediaPlayer#MEDIA_INFO_BUFFERING_START) - [MediaPlayer.MEDIA_INFO_BUFFERING_END](/reference/android/media/MediaPlayer#MEDIA_INFO_BUFFERING_END) - `MEDIA_INFO_NETWORK_BANDWIDTH (703)` - bandwidth information is available (as `extra` kbps) - [MediaPlayer.MEDIA_INFO_BAD_INTERLEAVING](/reference/android/media/MediaPlayer#MEDIA_INFO_BAD_INTERLEAVING) - [MediaPlayer.MEDIA_INFO_NOT_SEEKABLE](/reference/android/media/MediaPlayer#MEDIA_INFO_NOT_SEEKABLE) - [MediaPlayer.MEDIA_INFO_METADATA_UPDATE](/reference/android/media/MediaPlayer#MEDIA_INFO_METADATA_UPDATE) - [MediaPlayer.MEDIA_INFO_UNSUPPORTED_SUBTITLE](/reference/android/media/MediaPlayer#MEDIA_INFO_UNSUPPORTED_SUBTITLE) - [MediaPlayer.MEDIA_INFO_SUBTITLE_TIMED_OUT](/reference/android/media/MediaPlayer#MEDIA_INFO_SUBTITLE_TIMED_OUT) \u003cbr /\u003e |\n| `extra` | `int`: an extra code, specific to the info. Typically implementation dependent. \u003cbr /\u003e |\n\n| Returns ||\n|-----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `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. \u003cbr /\u003e |"]]