Make audio tag cope with live streams

Live streams seem to take a little while to initialize, so it's feasible
that we might get a play request before transitioned to the PREPARED
state. In that case track that we should start playing when onPrepare
completes.

Change-Id: I66ed0ef3a0905a1c5d4206fb2e7bbcc05a593fc7
This commit is contained in:
Ben Murdoch
2010-12-09 15:47:50 +00:00
parent 3f98f7bd53
commit 9059f44fee

View File

@@ -179,7 +179,7 @@ class HTML5Audio extends Handler
}
private void play() {
if ((mState == ERROR || mState == IDLE) && mUrl != null) {
if ((mState >= ERROR && mState < PREPARED) && mUrl != null) {
resetMediaPlayer();
setDataSource(mUrl);
mAskToPlay = true;