title: Embedding YouTube live stream in android application
body: <p>I'm embedding youtube live stream using webview in my android app. I'm using <code>iframe</code> for the same. Is there a way i can set the size of video player according to screen size. </p>
  
  <pre><code> public class WebViewPlayer extends AppCompatActivity {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_web_view_player);
  
          String frameVideo = "&lt;html&gt;&lt;body&gt;Youtube video .. &lt;br&gt; &lt;iframe width=\"400\" height=\"290\" src=\"https://www.youtube.com/embed/live_stream?channel=UCYn0pQcA8IMxk4cDFzlBF2w&amp;autoplay=1\" frameborder=\"0\" allowfullscreen=\"true\"&gt;&lt;/iframe&gt;&lt;/body&gt;&lt;/html&gt;";
  
          WebView webView = (WebView)findViewById(R.id.webview);
          webView.setWebViewClient(new WebViewClient(){
              @Override
              public boolean shouldOverrideUrlLoading(WebView view, String url) {
                  return false;
              }
          });
          WebSettings webSettings = webView.getSettings();
          webSettings.setJavaScriptEnabled(true);
          webView.loadData(frameVideo, "text/html", "utf-8");
      }
  }
  </code></pre>