title: Android webview video autoplay success, but same apk fails on android Tv mini pc?
body: <p>I have managed to get my video autoplay inside my webview.apk, tested on my phone (4.1.2) and it works, while on my android mini pc (4.2) has to be clicked to start the playback...:(</p>
  
  <p>Could WebChromeClient may be the reason? If it has something in common with chromium, which fails to autoplay as well, while the stock web browser plays nicely??</p>
  
  <p>The javascript I use to get the autoplay working is the following:</p>
  
  <pre><code>&lt;html&gt;
    &lt;head&gt;
  
        &lt;script&gt;
  
  function callback () {
      document.querySelector('video').play();
          }
  
         window.addEventListener("load", callback, false);
  
  
      &lt;/script&gt;
  
    &lt;/head&gt;
  
  
  
  &lt;body&gt;
    &lt;div id="video_post1" style="margin: -454px 0px 0px -3px;position: absolute;"&gt;
  &lt;video controls autoplay with="600" height="400"&gt;
  
    &lt;source src="http://www.edmondvarga.com/demo/videos/trx.mp4" type="video/mp4"&gt;
  
  
  &lt;/video&gt;
    &lt;/div&gt;
  
      &lt;/body&gt;
      &lt;/html&gt;
  </code></pre>
  
  <p>Maybe I would use another syntax to play it (like: document ready)?</p>
  
  <p>Eclipse code, just for demonstration:</p>
  
  <pre><code>package tscolari.mobile_sample;
  
  import android.app.Activity;
  import android.os.Bundle;
  import android.view.View;
  import android.webkit.WebSettings;
  import android.webkit.WebView;
  import android.webkit.WebViewClient;
  import android.webkit.WebChromeClient;
  
  import android.media.MediaPlayer;
  
  
  public class InfoSpotActivity extends Activity {
      /** Called when the activity is first created. */
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
  
  
          setContentView(R.layout.main);
  
          WebView mainWebView = (WebView) findViewById(R.id.mainWebView);
  
          WebSettings webSettings = mainWebView.getSettings();
          webSettings.setJavaScriptEnabled(true);
  
          mainWebView.setWebChromeClient(new WebChromeClient());
  
          mainWebView.setWebViewClient(new MyCustomWebViewClient());
          mainWebView.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
  
  
  
  
          mainWebView.loadUrl("http://server.info-spot.net");
      }
  
  
      private class MyCustomWebViewClient extends WebViewClient {
          @Override
          public boolean shouldOverrideUrlLoading(WebView view, String url) {
              view.loadUrl(url);
              return true;
          }
      }
  }
  </code></pre>