summaryrefslogtreecommitdiff
path: root/core/java/android/webkit/HTML5VideoViewProxy.java
diff options
context:
space:
mode:
authorAndrei Popescu <andreip@google.com>2010-02-27 15:47:46 +0000
committerAndrei Popescu <andreip@google.com>2010-02-27 16:14:04 +0000
commit8aab46abca2cd0c100c90a569f6fc058ce6db5a8 (patch)
tree701b47340fc3073c1a7318388438642231a2c669 /core/java/android/webkit/HTML5VideoViewProxy.java
parentb5e15690dc9a21435c378cc73234d0a324f6eee8 (diff)
VideoPlayer::onPrepared() can be called after the user pressed back in the VideoView.
This can cass a NPE since our Timer would have been destroyed by then. Add call to VideoView.stopPlayback() when the view is dismissed by the user. Fix b: 2476002, 2475786, 2475786
Diffstat (limited to 'core/java/android/webkit/HTML5VideoViewProxy.java')
-rw-r--r--core/java/android/webkit/HTML5VideoViewProxy.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/java/android/webkit/HTML5VideoViewProxy.java b/core/java/android/webkit/HTML5VideoViewProxy.java
index 85f1d5cb4dd4..42e153988a21 100644
--- a/core/java/android/webkit/HTML5VideoViewProxy.java
+++ b/core/java/android/webkit/HTML5VideoViewProxy.java
@@ -131,6 +131,7 @@ class HTML5VideoViewProxy extends Handler
mTimer = null;
mCurrentProxy.playbackEnded();
mCurrentProxy = null;
+ mVideoView.stopPlayback();
mLayout.removeView(mVideoView);
mVideoView = null;
if (mProgressView != null) {
@@ -218,11 +219,10 @@ class HTML5VideoViewProxy extends Handler
}
public static void onPrepared() {
- mTimer.schedule(new TimeupdateTask(mCurrentProxy), TIMEUPDATE_PERIOD, TIMEUPDATE_PERIOD);
-
if (mProgressView == null || mLayout == null) {
return;
}
+ mTimer.schedule(new TimeupdateTask(mCurrentProxy), TIMEUPDATE_PERIOD, TIMEUPDATE_PERIOD);
mProgressView.setVisibility(View.GONE);
mLayout.removeView(mProgressView);
mProgressView = null;