title: YouTube Video not playing in WebView - Android
body: <p>I am tying to play YouTube video in WebView, WebView showing first look of video with play button, But after click on play button start progress bar and after 2-3 seconds stop progress bar and screen blank with black color. </p>
  
  <p>Image1: Video first look with play button</p>
  
  <p>Image2: After click on play button screen goes blank.</p>
  
  <p>Please! help me why video not starting. </p>
  
  <p>IMAGE:1 <img src="https://i.stack.imgur.com/K4g1h.png" alt="This is first look of web view"></p>
  
  <p>IMAGE:2
  <img src="https://i.stack.imgur.com/IJ3aU.png" alt="enter image description here"></p>
  
  <p>This is my source code to play YouTubeVideo in webview.. Please help me ... </p>
  
  <pre><code>public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.main);
      WebView wv = (WebView) findViewById(R.id.webView1);
      wv.getSettings().setJavaScriptEnabled(true);
      wv.getSettings().setPluginsEnabled(true);
      final String mimeType = "text/html";
      final String encoding = "UTF-8";
      String html = getHTML();
      wv.loadDataWithBaseURL("", html, mimeType, encoding, "");
  }
  
  public String getHTML() {
      String html = "&lt;iframe class=\"youtube-player\" style=\"border: 0; width: 100%; height: 95%; padding:0px; margin:0px\" id=\"ytplayer\" type=\"text/html\" src=\"http://www.youtube.com/embed/"
              + "J2fB5XWj6IE"
              + "?fs=0\" frameborder=\"0\"&gt;\n"
              + "&lt;/iframe&gt;\n";
      return html;
  }
  </code></pre>