Auto play video in webview
<p>I am new in android and I am displaying a news link in a webview. News link contains a video. Problem is that, After opening a link i have to click on video then video is playing but i want that video should be play automatically.</p>

<p>Thanks in advance.</p>

<p>My code is:</p>

<pre><code>myWebView.getSettings().setJavaScriptEnabled(true);
myWebView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
myWebView.getSettings().setPluginState(PluginState.ON);         

myWebView.setWebViewClient(new WebViewClient() {
    public void onPageFinished(WebView view, String url) { web.loadUrl("javascript:(function() { document.getElementsByTagName('video')[0].play(); })()"); }
    });

myWebView.getSettings().setMediaPlaybackRequiresUserGesture(false);
myWebView.setWebChromeClient(new WebChromeClient());
myWebView.loadUrl("http://aajtak.intoday.in/livetv.html");  
</code></pre>