title: Android. Fit webview size to youtube video size
body: <p>I'd like to play youtube video by using android webview. <strong>But I want to fit my webview to youtube video size.</strong> Until now, my implementaion is like below.</p>
  
  <pre><code>        String vid = TextUtils.extractYoutubeVId(body);
          if (StringUtils.isBlank(vid)) {
              return null;
          }
  
          String html = "&lt;html &gt; &lt;head&gt;&lt;/head&gt; &lt;body style=\"margin:0 0 0 0; padding:0 0 0 0;\"&gt; &lt;iframe width=\"100%\" height=\"100%\" src=\"http://www.youtube.com/embed/___\" frameborder=\"0\"&gt;&lt;/iframe&gt; &lt;/body&gt; &lt;/html&gt; ";
          html = html.replace("___", vid);
  
          mImportedVideoWebview.setWebChromeClient(new WebChromeClient());
          WebSettings webSettings = mImportedVideoWebview.getSettings();
          webSettings.setJavaScriptEnabled(true);
          mImportedVideoWebview.loadData(html, "text/html", "utf-8");
  </code></pre>
  
  <p>mImportedVideoWebview is just a WebView and its width is MATCH_PARENT and height is 350dp.</p>
  
  <p>By using above code, I can play youtube video.</p>
  
  <p>But, I want to put my webview width to screen width and fit my webview's height to youtube video height proportionally. Anyone help me plz!</p>
  
  <p>Thanks!</p>