Loading core/java/android/webkit/HTML5VideoFullScreen.java +0 −3 Original line number Original line Diff line number Diff line Loading @@ -209,9 +209,6 @@ public class HTML5VideoFullScreen extends HTML5VideoView // which happens when the video view is detached from its parent // which happens when the video view is detached from its parent // view. This happens in the WebChromeClient before this method // view. This happens in the WebChromeClient before this method // is invoked. // is invoked. mTimer.cancel(); mTimer = null; pauseAndDispatch(mProxy); pauseAndDispatch(mProxy); mLayout.removeView(getSurfaceView()); mLayout.removeView(getSurfaceView()); Loading core/java/android/webkit/HTML5VideoView.java +15 −6 Original line number Original line Diff line number Diff line Loading @@ -68,6 +68,14 @@ public class HTML5VideoView implements MediaPlayer.OnPreparedListener{ // common Video control FUNCTIONS: // common Video control FUNCTIONS: public void start() { public void start() { if (mCurrentState == STATE_PREPARED) { if (mCurrentState == STATE_PREPARED) { // When replaying the same video, there is no onPrepared call. // Therefore, the timer should be set up here. if (mTimer == null) { mTimer = new Timer(); mTimer.schedule(new TimeupdateTask(mProxy), TIMEUPDATE_PERIOD, TIMEUPDATE_PERIOD); } mPlayer.start(); mPlayer.start(); } } } } Loading @@ -76,8 +84,12 @@ public class HTML5VideoView implements MediaPlayer.OnPreparedListener{ if (mCurrentState == STATE_PREPARED && mPlayer.isPlaying()) { if (mCurrentState == STATE_PREPARED && mPlayer.isPlaying()) { mPlayer.pause(); mPlayer.pause(); } } // Delete the Timer to stop it since there is no stop call. if (mTimer != null) { if (mTimer != null) { mTimer.purge(); mTimer.purge(); mTimer.cancel(); mTimer = null; } } } } Loading Loading @@ -129,6 +141,7 @@ public class HTML5VideoView implements MediaPlayer.OnPreparedListener{ mVideoLayerId = videoLayerId; mVideoLayerId = videoLayerId; mSaveSeekTime = position; mSaveSeekTime = position; mAutostart = autoStart; mAutostart = autoStart; mTimer = null; } } protected HTML5VideoView() { protected HTML5VideoView() { Loading @@ -153,8 +166,6 @@ public class HTML5VideoView implements MediaPlayer.OnPreparedListener{ // When switching players, surface texture will be reused. // When switching players, surface texture will be reused. mUri = uri; mUri = uri; mHeaders = generateHeaders(uri, proxy); mHeaders = generateHeaders(uri, proxy); mTimer = new Timer(); } } // Listeners setup FUNCTIONS: // Listeners setup FUNCTIONS: Loading Loading @@ -228,11 +239,9 @@ public class HTML5VideoView implements MediaPlayer.OnPreparedListener{ public void onPrepared(MediaPlayer mp) { public void onPrepared(MediaPlayer mp) { mCurrentState = STATE_PREPARED; mCurrentState = STATE_PREPARED; seekTo(mSaveSeekTime); seekTo(mSaveSeekTime); if (mProxy != null) if (mProxy != null) { mProxy.onPrepared(mp); mProxy.onPrepared(mp); } mTimer.schedule(new TimeupdateTask(mProxy), TIMEUPDATE_PERIOD, TIMEUPDATE_PERIOD); } } // Pause the play and update the play/pause button // Pause the play and update the play/pause button Loading Loading
core/java/android/webkit/HTML5VideoFullScreen.java +0 −3 Original line number Original line Diff line number Diff line Loading @@ -209,9 +209,6 @@ public class HTML5VideoFullScreen extends HTML5VideoView // which happens when the video view is detached from its parent // which happens when the video view is detached from its parent // view. This happens in the WebChromeClient before this method // view. This happens in the WebChromeClient before this method // is invoked. // is invoked. mTimer.cancel(); mTimer = null; pauseAndDispatch(mProxy); pauseAndDispatch(mProxy); mLayout.removeView(getSurfaceView()); mLayout.removeView(getSurfaceView()); Loading
core/java/android/webkit/HTML5VideoView.java +15 −6 Original line number Original line Diff line number Diff line Loading @@ -68,6 +68,14 @@ public class HTML5VideoView implements MediaPlayer.OnPreparedListener{ // common Video control FUNCTIONS: // common Video control FUNCTIONS: public void start() { public void start() { if (mCurrentState == STATE_PREPARED) { if (mCurrentState == STATE_PREPARED) { // When replaying the same video, there is no onPrepared call. // Therefore, the timer should be set up here. if (mTimer == null) { mTimer = new Timer(); mTimer.schedule(new TimeupdateTask(mProxy), TIMEUPDATE_PERIOD, TIMEUPDATE_PERIOD); } mPlayer.start(); mPlayer.start(); } } } } Loading @@ -76,8 +84,12 @@ public class HTML5VideoView implements MediaPlayer.OnPreparedListener{ if (mCurrentState == STATE_PREPARED && mPlayer.isPlaying()) { if (mCurrentState == STATE_PREPARED && mPlayer.isPlaying()) { mPlayer.pause(); mPlayer.pause(); } } // Delete the Timer to stop it since there is no stop call. if (mTimer != null) { if (mTimer != null) { mTimer.purge(); mTimer.purge(); mTimer.cancel(); mTimer = null; } } } } Loading Loading @@ -129,6 +141,7 @@ public class HTML5VideoView implements MediaPlayer.OnPreparedListener{ mVideoLayerId = videoLayerId; mVideoLayerId = videoLayerId; mSaveSeekTime = position; mSaveSeekTime = position; mAutostart = autoStart; mAutostart = autoStart; mTimer = null; } } protected HTML5VideoView() { protected HTML5VideoView() { Loading @@ -153,8 +166,6 @@ public class HTML5VideoView implements MediaPlayer.OnPreparedListener{ // When switching players, surface texture will be reused. // When switching players, surface texture will be reused. mUri = uri; mUri = uri; mHeaders = generateHeaders(uri, proxy); mHeaders = generateHeaders(uri, proxy); mTimer = new Timer(); } } // Listeners setup FUNCTIONS: // Listeners setup FUNCTIONS: Loading Loading @@ -228,11 +239,9 @@ public class HTML5VideoView implements MediaPlayer.OnPreparedListener{ public void onPrepared(MediaPlayer mp) { public void onPrepared(MediaPlayer mp) { mCurrentState = STATE_PREPARED; mCurrentState = STATE_PREPARED; seekTo(mSaveSeekTime); seekTo(mSaveSeekTime); if (mProxy != null) if (mProxy != null) { mProxy.onPrepared(mp); mProxy.onPrepared(mp); } mTimer.schedule(new TimeupdateTask(mProxy), TIMEUPDATE_PERIOD, TIMEUPDATE_PERIOD); } } // Pause the play and update the play/pause button // Pause the play and update the play/pause button Loading