2

I'm trying and failing at properly showing fullscreen video.

My WebChromeClient implements onHideCustomView and onShowCustomView. My layout has separate layouts for showing video and displaying webView. The problem is that sometimes it works correctly, and other times it does not. It happens only with a single website. I've noticed, that video goes fullscreen correctly on JW player 7.2.2, while it fails often on JW player 6.12.4945.

Here's how it looks when clicking fullscreen button or double clicking the video. Notice that there is website contents above the video, and there is empty view at the bottom of screen: https://drive.google.com/file/d/0B942jMuE3MylMVZQNVp6X0Y2ZGc/view?usp=sharing

webChromeClient = new WebChromeClient() {
        @Override
        public void onProgressChanged(WebView view, int newProgress) {
            super.onProgressChanged(view, newProgress);
            progressBar.setProgress(newProgress);
        }
        @Override
        public void onHideCustomView() {
            fullscreen = false;
            showUI();
            mVideoView.removeAllViews();
        }

        @Override
        public void onShowCustomView(View view, CustomViewCallback callback) {
            fullscreen = true; //for onBackPressed
            hideUI();
            RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
            mVideoView.addView(view, params);
        }
    };

<RelativeLayout
    android:id="@+id/root"
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true">

    <RelativeLayout
        android:id="@+id/contentView"
        android:layout_width="match_parent"
        android:layout_height="match_parent"></RelativeLayout>
        <RelativeLayout
        android:id="@+id/videoView"
        android:layout_width="match_parent"
        android:layout_height="match_parent"/>

</RelativeLayout>
Marius Kaunietis
  • 674
  • 4
  • 17

0 Answers0