title: html5 video does not work with android webview
body: <p>I have been running the android app in webview for a year.
  But there are some customers who say html5 video is not playing in my app a few days ago.
  I have five phones for testing, and there is nothing wrong with all my phones. Most customers are using the app without any problems.</p>
  
  <p>I changed the preload property value from auto to meta because I want to be due to network load.</p>
  
  <p>The picture below is a screenshot from the customer.
  There is a time of 27:10, and there is no spinner for loading. (I think loading is over)
  However, the customer can not press the play button, and when the play button is pressed, an orange line appears around the video element.</p>
  
  <p><a href="https://i.stack.imgur.com/kw3cC.png" rel="noreferrer"><img src="https://i.stack.imgur.com/kw3cC.png" alt="enter image description here"></a></p>
  
  <p>The customer's cell phone is galaxy note 8 &amp; galaxy J7 and the android version is 8. But in my test there was no problem. And there are Android 8 customers who are using the service without any problems.</p>
  
  <p>How can I solve it? thanks. </p>
  
  <p>html</p>
  
  <pre><code>&lt;video preload="meta" width="95%" autoplay="autoplay" controls="" playsinline=""&gt;               
          &lt;source type="video/mp4" src="url.../file.mp4"&gt;
          HTML5 is not supported.
      &lt;/video&gt;
  </code></pre>
  
  <p>android - MainActivity</p>
  
  <pre><code>public class MainActivity extends AppCompatActivity {
  
      private WebView webView;
      private BackPressCloseHandler backPressCloseHandler = new BackPressCloseHandler(this);
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          webView = findViewById(R.id.webView);
          /* webView settings */
          webView.getSettings().setSupportZoom(true);
          webView.getSettings().setBuiltInZoomControls(true);
          webView.getSettings().setJavaScriptEnabled(true);
          webView.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
          webView.setWebChromeClient(new FullscreenableChromeClient(MainActivity.this));
          webView.setWebViewClient(new WebViewClientClass());
  
          webView.loadUrl("MY URL IS HERE");
      } //onCreate
  
      private class WebViewClientClass extends WebViewClient {
  
          @Override
          public boolean shouldOverrideUrlLoading(WebView view, String url) {
              view.loadUrl(url);
              return true;
          }
      }
  </code></pre>
  
  <p>custom class to enable video Fullscreen</p>
  
  <pre><code>import android.app.Activity;
  import android.content.Context;
  import android.os.Build;
  import android.support.v4.content.ContextCompat;
  import android.view.MotionEvent;
  import android.view.View;
  import android.view.ViewGroup;
  import android.view.Window;
  import android.view.WindowManager;
  import android.webkit.WebChromeClient;
  import android.widget.FrameLayout;
  
  public class FullscreenableChromeClient extends WebChromeClient {
      private Activity mActivity = null;
  
      private View mCustomView;
      private WebChromeClient.CustomViewCallback mCustomViewCallback;
      private int mOriginalOrientation;
      private FrameLayout mFullscreenContainer;
      private static final FrameLayout.LayoutParams COVER_SCREEN_PARAMS = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
  
      public FullscreenableChromeClient(Activity activity) {
          this.mActivity = activity;
      }
  
      @Override
      public void onShowCustomView(View view, CustomViewCallback callback) {
  
          if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
              if (mCustomView != null) {
                  callback.onCustomViewHidden();
                  return;
              }
  
              mOriginalOrientation = mActivity.getRequestedOrientation();
              FrameLayout decor = (FrameLayout) mActivity.getWindow().getDecorView();
              mFullscreenContainer = new FullscreenHolder(mActivity);
              mFullscreenContainer.addView(view, COVER_SCREEN_PARAMS);
              decor.addView(mFullscreenContainer, COVER_SCREEN_PARAMS);
              mCustomView = view;
              setFullscreen(true);
              mCustomViewCallback = callback;
  //          mActivity.setRequestedOrientation(requestedOrientation);
  
          }
  
          super.onShowCustomView(view, callback);
      }
  
      @SuppressWarnings("deprecation")
      @Override
      public void onShowCustomView(View view, int requestedOrientation, WebChromeClient.CustomViewCallback callback) {
          this.onShowCustomView(view, callback);
      }
  
      @Override
      public void onHideCustomView() {
          if (mCustomView == null) {
              return;
          }
  
          setFullscreen(false);
          FrameLayout decor = (FrameLayout) mActivity.getWindow().getDecorView();
          decor.removeView(mFullscreenContainer);
          mFullscreenContainer = null;
          mCustomView = null;
          mCustomViewCallback.onCustomViewHidden();
          mActivity.setRequestedOrientation(mOriginalOrientation);
  
      }
  
      private void setFullscreen(boolean enabled) {
  
          Window win = mActivity.getWindow();
          WindowManager.LayoutParams winParams = win.getAttributes();
          final int bits = WindowManager.LayoutParams.FLAG_FULLSCREEN;
          if (enabled) {
              winParams.flags |= bits;
          } else {
              winParams.flags &amp;= ~bits;
              if (mCustomView != null) {
                  mCustomView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_VISIBLE);
              }
          }
          win.setAttributes(winParams);
      }
  
      private static class FullscreenHolder extends FrameLayout {
          public FullscreenHolder(Context ctx) {
              super(ctx);
              setBackgroundColor(ContextCompat.getColor(ctx, android.R.color.black));
          }
          @Override
          public boolean onTouchEvent(MotionEvent evt) {
              return true;
          }
      }
  }
  </code></pre>
  
  <p>manifest.xml</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="..."&gt;
  
      &lt;uses-permission android:name="android.permission.INTERNET" /&gt;
      &lt;uses-permission android:name="android.permission.READ_PHONE_STATE" /&gt;
  
      &lt;application
          android:allowBackup="true"
          android:icon="@mipmap/ic_launcher"
          android:label="@string/app_name"
          android:roundIcon="@mipmap/ic_launcher_round"
          android:supportsRtl="true"
          android:hardwareAccelerated="true"
          android:theme="@style/AppTheme"&gt;
          &lt;activity android:name="....webview.MainActivity"
              android:configChanges="keyboardHidden|orientation|screenSize"&gt;
  
          &lt;/activity&gt;
          &lt;activity android:name="....webview.IntroActivity"&gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.MAIN" /&gt;
                  &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
              &lt;/intent-filter&gt;
  
          &lt;/activity&gt;
      &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>