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
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user