Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot play video inside WebView using iframe tag?

I am using the following data to display in a WebView. These are the HTML tags along with the iframe which is referring to a video.

Now the problem is when I click on it, it shows the play button but cannot play the video.

Can I play this video inside WebView or not?

<p></p><P> because of Jon’s pro-growth, business-friendly policies, Utah's economy expanded at more than triple the national rate and was named the best state for business by <EM>Forbes.</em><BR /><BR /><IFRAME height=241 src="http://player.vimeo.com/video/25349114" frameBorder=0 width=425></iframe></p><br />

<P>America needs a dose of the same medicine. Today, our nation has the second highest corporate tax rate in the developed world. We have convoluted and confusing regulations. 
<!--break--><!--break--><p></p>

when I try to run this url in the android browser it opens videoview and plays that file perfectly but why not in iframe? http://player.vimeo.com/video/25349114

like image 688
UMAR-MOBITSOLUTIONS Avatar asked Jul 01 '11 10:07

UMAR-MOBITSOLUTIONS


2 Answers

The key thing is to enable browser plugins.

// how to enable the webview plugin changed in API 8
if (Build.VERSION.SDK_INT < 8) {
    mWebView.getSettings().setPluginsEnabled(true);
} else {
    mWebView.getSettings().setPluginState(PluginState.ON);
}

Also worth checking flash player is installed

like image 158
scottyab Avatar answered Sep 24 '22 14:09

scottyab


WebView wv;
wv = (WebView) findViewById(R.id.mywebview);

wv.getSettings().setJavaScriptEnabled(true);
wv.getSettings().setBuiltInZoomControls(true);
wv.getSettings().setPluginsEnabled(true);

Use this code to load your video and also update the flashplayer of your device...

like image 27
Dhrumil Shah - dhuma1981 Avatar answered Sep 21 '22 14:09

Dhrumil Shah - dhuma1981