From ea763069b1dca16193d32c6cf3ceab1c23743271 Mon Sep 17 00:00:00 2001 From: Jean-Michel Trivi Date: Wed, 6 Apr 2011 10:34:09 -0700 Subject: [PATCH] Bug 4231349 fix error in javadoc for android.media.MediaPlayer In the javadoc for MediaPlayer.OnBufferingUpdateListener, the percent parameter for onBufferingUpdate() is described as: the percentage (0-100) of the buffer that has been filled thus far This is incorrect. This percentage is the ratio of (current position + content buffered) relative to the total duration. Also buffering updates are only sent for progressive HTTP download. Change-Id: I9f346a150b39fa1f7b17126119ecc0d7d27fbfbe --- media/java/android/media/MediaPlayer.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/media/java/android/media/MediaPlayer.java b/media/java/android/media/MediaPlayer.java index e2dee00e421e5..0b0d145a6a205 100644 --- a/media/java/android/media/MediaPlayer.java +++ b/media/java/android/media/MediaPlayer.java @@ -1462,11 +1462,16 @@ public class MediaPlayer public interface OnBufferingUpdateListener { /** - * Called to update status in buffering a media stream. + * 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. * * @param mp the MediaPlayer the update pertains to - * @param percent the percentage (0-100) of the buffer - * that has been filled thus far + * @param percent the percentage (0-100) of the content + * that has been buffered or played thus far */ void onBufferingUpdate(MediaPlayer mp, int percent); }