Stay organized with collections
Save and categorize content based on your preferences.
OnBufferingUpdateListener
interface OnBufferingUpdateListener
Interface definition of a callback to be invoked indicating buffering status of a media resource being streamed over the network.
Summary
Public methods |
abstract Unit |
Called to update status in buffering a media stream received through progressive HTTP download.
|
Public methods
onBufferingUpdate
abstract fun onBufferingUpdate(
mp: MediaPlayer!,
percent: Int
): Unit
Called to update status in buffering a media stream received through progressive HTTP download. The received buffering percentage indicates how much of the content has been buffered or played. For example a buffering update of 80 percent when half the content has already been played indicates that the next 30 percent of the content to play has been buffered.
Parameters |
mp |
MediaPlayer!: the MediaPlayer the update pertains to |
percent |
Int: the percentage (0-100) of the content that has been buffered or played thus far |
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.OnBufferingUpdateListener\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nOnBufferingUpdateListener\n=========================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/media/MediaPlayer.OnBufferingUpdateListener \"View this page in Java\") \n\n```\ninterface OnBufferingUpdateListener\n```\n\n|----------------------------------------------------------|\n| [android.media.MediaPlayer.OnBufferingUpdateListener](#) |\n\nInterface definition of a callback to be invoked indicating buffering status of a media resource being streamed over the network.\n\nSummary\n-------\n\n| Public methods ||\n|---------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onBufferingUpdate](#onBufferingUpdate(android.media.MediaPlayer,%20kotlin.Int))`(`mp:` `[MediaPlayer](/reference/kotlin/android/media/MediaPlayer)!`, `percent:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Called to update status in buffering a media stream received through progressive HTTP download. |\n\nPublic methods\n--------------\n\n### onBufferingUpdate\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun onBufferingUpdate(\n mp: MediaPlayer!, \n percent: Int\n): Unit\n```\n\nCalled to update status in buffering a media stream received through progressive HTTP download. The received buffering percentage indicates how much of the content has been buffered or played. For example a buffering update of 80 percent when half the content has already been played indicates that the next 30 percent of the content to play has been buffered.\n\n| Parameters ||\n|-----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `mp` | [MediaPlayer](/reference/kotlin/android/media/MediaPlayer)!: the MediaPlayer the update pertains to |\n| `percent` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): the percentage (0-100) of the content that has been buffered or played thus far |"]]