getDuration can be only called after prepared. DO NOT MERGE

bug:5816130
Change-Id: Ia740a1a4da7f321356f24c35067f9499955289a9
This commit is contained in:
Teng-Hui Zhu
2012-01-04 17:15:46 -08:00
parent dacbf67ab9
commit 149537cb70

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);