无法使用iframe标记在WebView中播放视频?

时间:2011-07-01 10:46:47

标签: android iframe webview

我正在使用以下数据在WebView中显示。这些是HTML标签 iframe是指视频。

现在的问题是,当我点击它时,它会显示播放按钮,但无法播放视频。

我可以在WebView内播放此视频吗?

<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>

当我尝试在Android浏览器中运行此URL时,它会打开videoview并完美播放该文件,但为什么不在iframe中? http://player.vimeo.com/video/25349114

2 个答案:

答案 0 :(得分:3)

关键是启用浏览器插件。

// 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);
}

还值得查看flash player is installed

答案 1 :(得分:2)

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

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

使用此代码加载视频并更新设备的Flashplayer ......