title: How to full screen video from webview
body: <p>Here is my code. I have built webview for youtube and using WebChromClient tried to add full screen feature on app. But when clicked on fullscreen it gives blank screen and auido is played in back ground.</p>
  
  <p><strong>MainAvtivity</strong></p>
  
  <pre><code>public class MainActivity extends AppCompatActivity {
  
  public WebView mywebview;
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
      mywebview = (WebView)findViewById(R.id.youtube_webview);
  
      WebSettings webSettings =mywebview.getSettings();
      webSettings.setJavaScriptEnabled(true);
      mywebview.setWebChromeClient(new CrmClient());
      mywebview.setWebViewClient(new WebViewClient());
      mywebview.getSettings().setJavaScriptEnabled(true);
      mywebview.setVerticalScrollBarEnabled(false);
      mywebview.setHorizontalScrollBarEnabled(false);
          mywebview.loadUrl("https://www.youtube.com");
  
  }
  
  
  
  class CrmClient extends WebChromeClient{
  
      @Override
      public void onShowCustomView(View view, CustomViewCallback callback) {
          super.onShowCustomView(view, callback);
      }
  
      @Override
      public void onHideCustomView() {
          super.onHideCustomView();
      }
  }
  
  
  
  
  @Override
  protected void onPause() {
      super.onPause();
      if(mywebview != null) {
          mywebview.onPause();
          mywebview.pauseTimers();
      }
  }
  
  @Override
  protected void onResume() {
      super.onResume();
      if(mywebview != null){
          mywebview.onResume();
          mywebview.resumeTimers();
      }
  }
  
  @Override
  public void onBackPressed() {
      if (mywebview.canGoBack())
          mywebview.goBack();
      else
          super.onBackPressed();
  }
  </code></pre>
  
  <p><strong>Activity_main.XML</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  tools:context=".MainActivity"&gt;
  
  &lt;WebView
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:id="@+id/youtube_webview" &gt;
  
      &lt;FrameLayout
          android:layout_width="fill_parent"
          android:layout_height="fill_parent"
          &gt;
  
      &lt;/FrameLayout&gt;
  &lt;/WebView&gt;
  </code></pre>
  
  <p></p>
  
  <p><strong>AndroidMainFest.XML</strong></p>
  
  <pre><code>&lt;uses-permission android:name="android.permission.INTERNET" /&gt;
  
  &lt;application
      android:allowBackup="true"
      android:icon="@mipmap/ic_launcher"
      android:label="@string/app_name"
      android:supportsRtl="true"
      android:theme="@style/AppTheme" &gt;
      &lt;activity android:name=".MainActivity"
          android:configChanges="orientation|screenSize"
          android:label="@string/app_name"&gt; 
          &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;
  </code></pre>
  
  <p></p>