Note that there are some explanatory texts on larger screens.

plurals
  1. POYoutube embed videos not working in webview. What's wrong with this code?
    primarykey
    data
    text
    <p>I am new to android. I am facing two problems right now <strong>1</strong>. I parsed xml file and showed it in webview which contains videos and text . When i click on videos it will not play . In xml videos are youtube embed.</p> <p>Why is it so?</p> <p>1.First problem :code and image</p> <pre><code>protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.web_view); Intent intent=getIntent(); String urlsting=intent.getStringExtra("str"); mWebView = (WebView) findViewById(R.id.webview); mWebView.getSettings().setJavaScriptEnabled(true); mWebView.getSettings().setPluginState(PluginState.ON); mWebView.getSettings().setPluginsEnabled(true); mWebView.setInitialScale(100); mWebView.getSettings().setBuiltInZoomControls(true); mWebView.loadDataWithBaseURL(null, urlsting,"text/html", "utf-8", null); } </code></pre> <p>When i clcik on video it starts browsing and shows only black screen,then nothing will happen. </p> <p>![][1]</p> <p><strong>2.</strong> I have you-tube embedded videos url which I given in html tag and try to load it .They are also not working for me. I checked number of questions and blogs and also made no of settings then also unable to show video . Help will be appreciated .Thanks in advance.</p> <pre><code>String video= "&lt;table bgcolor=\"#666666\"&gt;&lt;tr&gt;&lt;td&gt;&lt;iframe width=\"300\" height=\"260\" frameborder=\"0\" id=\"player\" type=\"text/html\"src=\"http://www.youtube.com/embed/iiLepwjBhZE?enablejsapi=1&amp;origin=example.com\"&gt;&lt;/iframe&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;iframe width=\"300\" height=\"260\" frameborder=\"0\" id=\"player\" type=\"text/html\"src=\"http://www.youtube.com/embed/lBMMTeuJ_UQ?enablejsapi=1&amp;origin=example.com\"&gt;&lt;/iframe&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;iframe width=\"300\" height=\"260\" frameborder=\"0\" id=\"player\" type=\"text/html\"src=\"http://www.youtube.com/embed/BZMkY3y7nM0?enablejsapi=1&amp;origin=example.com\"&gt;&lt;/iframe&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;/table&gt;"; mWebView = (WebView) findViewById(R.id.webview); mWebView.getSettings().setJavaScriptEnabled(true); mWebView.getSettings().setPluginState(PluginState.ON); mWebView.getSettings().setPluginsEnabled(true); //mWebView.loadDataWithBaseURL(null,load,"text/html","UTF-8",null); mWebView.loadData(video,"text/html","UTF-8"); </code></pre> <p>In this case I load the youtube embeded videos to webview but they are also not working.</p> <p>![][2]</p> <p>I am using android 2.3.3version.I also want clarification that is there any requirement of install adobe flash player on emulator, but i think no because videos are working in browser. can anybody tell i am right or wrong?? please try to give me solution because i stuck with this problem long ago.. </p> <p>I also tried using object tag as follows:</p> <pre><code> String obj="&lt;object width=\"300\" height=\"260\"&gt;&lt;param name=\"movie\" value=\"http://www.youtube.com/embed/iiLepwjBhZE?enablejsapi=1&amp;origin=example.com\"?version=3&amp;amp;hl=pt_BR&amp;amp;rel=0\"&gt;&lt;/param&gt;&lt;param name=\"allowFullScreen\" value=\"true\"&gt;&lt;/param&gt;&lt;param name=\"allowscriptaccess\" value=\"always\"&gt;&lt;/param&gt;&lt;embed src=\"http://www.youtube.com/embed/iiLepwjBhZE?enablejsapi=1&amp;origin=example.com\" ?version=3&amp;amp;hl=pt_BR&amp;amp;rel=0\" type=\"application/x-shockwave-flash\" width=\"480\" height=\"330\" allowscriptaccess=\"always\" allowfullscreen=\"true\" /&gt;&lt;/object&gt;"; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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