Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2075f2d3 authored by Teng-Hui Zhu's avatar Teng-Hui Zhu Committed by Android (Google) Code Review
Browse files

Merge "Notify Java side to start when transition into full screen mode without...

Merge "Notify Java side to start when transition into full screen mode without a reload." into jb-dev
parents 17b9cec1 6a9586bc
Loading
Loading
Loading
Loading
+10 −7
Original line number Diff line number Diff line
@@ -194,13 +194,6 @@ public class HTML5VideoFullScreen extends HTML5VideoView
            mCanPause = mCanSeekBack = mCanSeekForward = true;
        }

        // mMediaController status depends on the Metadata result, so put it
        // after reading the MetaData
        if (mMediaController != null) {
            mMediaController.setEnabled(true);
            mMediaController.show();
        }

        if (mProgressView != null) {
            mProgressView.setVisibility(View.GONE);
        }
@@ -215,6 +208,16 @@ public class HTML5VideoFullScreen extends HTML5VideoView

        if (getStartWhenPrepared()) {
            mPlayer.start();
            // Clear the flag.
            setStartWhenPrepared(false);
        }

        // mMediaController status depends on the Metadata result, so put it
        // after reading the MetaData.
        // And make sure mPlayer state is updated before showing the controller.
        if (mMediaController != null) {
            mMediaController.setEnabled(true);
            mMediaController.show();
        }
    }

+6 −1
Original line number Diff line number Diff line
@@ -147,6 +147,7 @@ class HTML5VideoViewProxy extends Handler
                // Save the inline video info and inherit it in the full screen
                int savePosition = 0;
                boolean canSkipPrepare = false;
                boolean forceStart = false;
                if (mHTML5VideoView != null) {
                    // We don't allow enter full screen mode while the previous
                    // full screen video hasn't finished yet.
@@ -154,11 +155,11 @@ class HTML5VideoViewProxy extends Handler
                        Log.w(LOGTAG, "Try to reenter the full screen mode");
                        return;
                    }
                    int playerState = mHTML5VideoView.getCurrentState();
                    // If we are playing the same video, then it is better to
                    // save the current position.
                    if (layerId == mHTML5VideoView.getVideoLayerId()) {
                        savePosition = mHTML5VideoView.getCurrentPosition();
                        int playerState = mHTML5VideoView.getCurrentState();
                        canSkipPrepare = (playerState == HTML5VideoView.STATE_PREPARING
                                || playerState == HTML5VideoView.STATE_PREPARED
                                || playerState == HTML5VideoView.STATE_PLAYING)
@@ -166,10 +167,14 @@ class HTML5VideoViewProxy extends Handler
                    }
                    if (!canSkipPrepare) {
                        mHTML5VideoView.reset();
                    } else {
                        forceStart = playerState == HTML5VideoView.STATE_PREPARING
                                || playerState == HTML5VideoView.STATE_PLAYING;
                    }
                }
                mHTML5VideoView = new HTML5VideoFullScreen(proxy.getContext(),
                        layerId, savePosition, canSkipPrepare);
                mHTML5VideoView.setStartWhenPrepared(forceStart);
                mCurrentProxy = proxy;
                mHTML5VideoView.setVideoURI(url, mCurrentProxy);
                mHTML5VideoView.enterFullScreenVideoState(layerId, proxy, webView);