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

Commit b109c887 authored by Teng-Hui Zhu's avatar Teng-Hui Zhu
Browse files

Exit full screen support on java side

bug:4312214

Change-Id: Id3c755db0a824d42f1f8d1a0952f63d2078d163a
parent 8755cc09
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -208,7 +208,7 @@ public class HTML5VideoFullScreen extends HTML5VideoView
                // view. This happens in the WebChromeClient before this method
                // is invoked.
                pauseAndDispatch(mProxy);

                mProxy.dispatchOnStopFullScreen();
                mLayout.removeView(getSurfaceView());

                if (mProgressView != null) {
@@ -253,7 +253,8 @@ public class HTML5VideoFullScreen extends HTML5VideoView
        client.onShowCustomView(mLayout, mCallback);
        // Plugins like Flash will draw over the video so hide
        // them while we're playing.
        mProxy.getWebView().getViewManager().hideAll();
        if (webView.getViewManager() != null)
            webView.getViewManager().hideAll();

        mProgressView = client.getVideoLoadingProgressView();
        if (mProgressView != null) {
+12 −2
Original line number Diff line number Diff line
@@ -65,6 +65,7 @@ class HTML5VideoViewProxy extends Handler
    private static final int ENDED             = 201;
    private static final int POSTER_FETCHED    = 202;
    private static final int PAUSED            = 203;
    private static final int STOPFULLSCREEN    = 204;

    // Timer thread -> UI thread
    private static final int TIMEUPDATE = 300;
@@ -291,6 +292,11 @@ class HTML5VideoViewProxy extends Handler
        mWebCoreHandler.sendMessage(msg);
    }

    public void dispatchOnStopFullScreen() {
        Message msg = Message.obtain(mWebCoreHandler, STOPFULLSCREEN);
        mWebCoreHandler.sendMessage(msg);
    }

    public void onTimeupdate() {
        sendMessage(obtainMessage(TIMEUPDATE));
    }
@@ -560,6 +566,9 @@ class HTML5VideoViewProxy extends Handler
                    case TIMEUPDATE:
                        nativeOnTimeupdate(msg.arg1, mNativePointer);
                        break;
                    case STOPFULLSCREEN:
                        nativeOnStopFullscreen(mNativePointer);
                        break;
                }
            }
        };
@@ -686,6 +695,7 @@ class HTML5VideoViewProxy extends Handler
    private native void nativeOnPaused(int nativePointer);
    private native void nativeOnPosterFetched(Bitmap poster, int nativePointer);
    private native void nativeOnTimeupdate(int position, int nativePointer);
    private native void nativeOnStopFullscreen(int nativePointer);
    private native static boolean nativeSendSurfaceTexture(SurfaceTexture texture,
            int baseLayer, int videoLayerId, int textureName,
            int playerState);