diff options
Diffstat (limited to 'core/java/android/webkit/HTML5VideoView.java')
-rw-r--r-- | core/java/android/webkit/HTML5VideoView.java | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/core/java/android/webkit/HTML5VideoView.java b/core/java/android/webkit/HTML5VideoView.java index 8ea73b5..fd3f358 100644 --- a/core/java/android/webkit/HTML5VideoView.java +++ b/core/java/android/webkit/HTML5VideoView.java @@ -15,7 +15,7 @@ import java.util.TimerTask; /** * @hide This is only used by the browser */ -public class HTML5VideoView implements MediaPlayer.OnPreparedListener{ +public class HTML5VideoView implements MediaPlayer.OnPreparedListener { protected static final String LOGTAG = "HTML5VideoView"; @@ -78,6 +78,7 @@ public class HTML5VideoView implements MediaPlayer.OnPreparedListener{ TIMEUPDATE_PERIOD); } mPlayer.start(); + setPlayerBuffering(false); } } @@ -189,6 +190,10 @@ public class HTML5VideoView implements MediaPlayer.OnPreparedListener{ mPlayer.setOnPreparedListener(this); } + public void setOnInfoListener(HTML5VideoViewProxy proxy) { + mPlayer.setOnInfoListener(proxy); + } + // Normally called immediately after setVideoURI. But for full screen, // this should be after surface holder created public void prepareDataAndDisplayMode(HTML5VideoViewProxy proxy) { @@ -198,7 +203,7 @@ public class HTML5VideoView implements MediaPlayer.OnPreparedListener{ setOnCompletionListener(proxy); setOnPreparedListener(proxy); setOnErrorListener(proxy); - + setOnInfoListener(proxy); // When there is exception, we could just bail out silently. // No Video will be played though. Write the stack for debug try { @@ -292,4 +297,21 @@ public class HTML5VideoView implements MediaPlayer.OnPreparedListener{ return 0; } + // This is true only when the player is buffering and paused + public boolean mPlayerBuffering = false; + + public boolean getPlayerBuffering() { + return mPlayerBuffering; + } + + public void setPlayerBuffering(boolean playerBuffering) { + mPlayerBuffering = playerBuffering; + switchProgressView(playerBuffering); + } + + + protected void switchProgressView(boolean playerBuffering) { + // Only used in HTML5VideoFullScreen + } + } |