Note that there are some explanatory texts on larger screens.

plurals
  1. POMargins for video in webview
    text
    copied!<p>I am trying to embed a youtube video inside a webview and it seems there is a small margin on the right-side of the video which is not going away.</p> <p>I saw many other Questions like these and tried fixing the javascript but still the margin is there.</p> <p>Here is my code :</p> <pre><code> video = (WebView) v.findViewById(R.id.videoview); // video.getSettings().setLoadWithOverviewMode(true); // video.getSettings().setUseWideViewPort(true); String widthAndHeight = "width='null' height='null'"; String videoURL = "http://www.youtube.com/v/DZi6DEJsOJ0"; video.setHorizontalScrollBarEnabled(false); video.setVerticalScrollBarEnabled(false); video.getSettings().setJavaScriptEnabled(true); video.getSettings().setPluginsEnabled(true); String temp = "&lt;object " + widthAndHeight + "&gt;" + "&lt;body style='margin:0;padding:0;rightmargin:0'&gt;" + "&lt;param name='allowFullScreen' value='true'&gt;" + "&lt;/param&gt;&lt;param name='allowscriptaccess' value='always'&gt;" + "&lt;/param&gt;&lt;embed src='" + videoURL + "'" + " type='application/x-shockwave-flash' style='margin:0;padding:0;' allowscriptaccess='always' allowfullscreen='true'" + widthAndHeight + "&gt;&lt;/embed&gt;&lt;/object&gt;"; video.loadData(temp, "text/html", "utf-8"); </code></pre> <p>I tried giving the style:body=0'margin=0 tag inside the javascript . I don't know how to upload the screenshot as i am debugging on my phone but its a video with a margin of about 6pixels on the right of the video while the left hand side and the top of the video are aligned with the screen.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload