Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid webview embedded youtube video autoloop
    text
    copied!<p>In my project I have a <code>WebView</code> which loads dynamically generated webpage with embedded youtube video like this:</p> <pre><code>&lt;iframe type="text/html" width="640" height="385" frameborder="0" src="http://www.youtube.com/embed/6nQCcgpDpXQ?autoplay=1&amp;&amp;playlist=6nQCcgpDpXQ&amp;loop=1"&gt; &lt;/iframe&gt; </code></pre> <p>If I check this web the video plays ok and loops ok as well.</p> <p>In the Android App I have the following code:</p> <pre><code> WebView engine = (WebView) findViewById(R.id.web_engine); engine.setWebChromeClient(new WebChromeClient()); engine.getSettings().setPluginState(PluginState.ON); engine.getSettings().setJavaScriptEnabled(true); engine.setInitialScale(100); engine.getSettings().setBuiltInZoomControls(true); engine.getSettings().setAllowFileAccess(true); engine.getSettings().setPluginsEnabled(true); engine.loadUrl(miUrl); </code></pre> <p>And it works, but</p> <ol> <li>Autoplay does not work I have to play it by hand</li> <li>Autoloop does not work, after the video finish it becomes all black, there is no menu, there is no play/pause/stop video. It is useless and if I want to play again I have to reload the entire page.</li> </ol> <p>One more thing, in this line:</p> <pre><code>engine.getSettings().setPluginsEnabled(true); </code></pre> <p>It says that it is deprecated.</p> <p>In the manifest I give Internet permission access to the application and I have Hardware acceleration to true.</p> <p>Can someone help me with this?</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