diff options
| author | Teng-Hui Zhu <ztenghui@google.com> | 2012-05-09 14:13:52 -0700 |
|---|---|---|
| committer | Teng-Hui Zhu <ztenghui@google.com> | 2012-05-10 16:46:51 -0700 |
| commit | c2b06d5a83f8f118eaf46f093126da08a28715eb (patch) | |
| tree | a5c9bd0cebb44c77d228828de76080aa793074f6 /core/java/android/webkit/HTML5VideoFullScreen.java | |
| parent | f4c77df0593c1bb81dd5ee04ee415a8cf3bd37bb (diff) | |
Avoid inline->fullscreen reload for html5 video.
Now when a user start inline play and then switch to full screen, there is no
reload any more.
Basically, we change mediaplayer as a static member, and detect possible
situation to skip the prepare work.
bug:5710646
Change-Id: Ida34cf2e919a6cc8e0d52cd1175d51b5f5d527f7
Diffstat (limited to 'core/java/android/webkit/HTML5VideoFullScreen.java')
| -rw-r--r-- | core/java/android/webkit/HTML5VideoFullScreen.java | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/core/java/android/webkit/HTML5VideoFullScreen.java b/core/java/android/webkit/HTML5VideoFullScreen.java index 730ad08db348..0ec91632b92d 100644 --- a/core/java/android/webkit/HTML5VideoFullScreen.java +++ b/core/java/android/webkit/HTML5VideoFullScreen.java @@ -104,7 +104,9 @@ public class HTML5VideoFullScreen extends HTML5VideoView // After we return from this we can't use the surface any more. // The current Video View will be destroy when we play a new video. pauseAndDispatch(mProxy); + // TODO: handle full screen->inline mode transition without a reload. mPlayer.release(); + mPlayer = null; mSurfaceHolder = null; if (mMediaController != null) { mMediaController.hide(); @@ -128,12 +130,12 @@ public class HTML5VideoFullScreen extends HTML5VideoView return mVideoSurfaceView; } - HTML5VideoFullScreen(Context context, int videoLayerId, int position) { + HTML5VideoFullScreen(Context context, int videoLayerId, int position, boolean skipPrepare) { mVideoSurfaceView = new VideoSurfaceView(context); mFullScreenMode = FULLSCREEN_OFF; mVideoWidth = 0; mVideoHeight = 0; - init(videoLayerId, position); + init(videoLayerId, position, skipPrepare); } private void setMediaController(MediaController m) { @@ -156,8 +158,6 @@ public class HTML5VideoFullScreen extends HTML5VideoView } private void prepareForFullScreen() { - // So in full screen, we reset the MediaPlayer - mPlayer.reset(); MediaController mc = new FullScreenMediaController(mProxy.getContext(), mLayout); mc.setSystemUiVisibility(mLayout.getSystemUiVisibility()); setMediaController(mc); @@ -243,7 +243,7 @@ public class HTML5VideoFullScreen extends HTML5VideoView // Don't show the controller after exiting the full screen. mMediaController = null; - mCurrentState = STATE_RELEASED; + mCurrentState = STATE_RESETTED; } }; |
