Merge "getDuration can be only called after prepared. DO NOT MERGE" into ics-mr1

This commit is contained in:
Bart Sears
2012-01-06 15:45:13 -08:00
committed by Android (Google) Code Review

View File

@@ -311,7 +311,11 @@ class HTML5Audio extends Handler
}
private float getMaxTimeSeekable() {
return mMediaPlayer.getDuration() / 1000.0f;
if (mState >= PREPARED) {
return mMediaPlayer.getDuration() / 1000.0f;
} else {
return 0;
}
}
private native void nativeOnBuffering(int percent, int nativePointer);