public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); WebView wv=(WebView)findViewById(R.id.webView1); wv.getSettings().setJavaScriptEnabled(true); wv.getSettings().setAppCacheEnabled(true); wv.getSettings().setDomStorageEnabled(true); // how plugin is enabled change in API 8 if (Build.VERSION.SDK_INT < 8) { wv.getSettings().setPluginsEnabled(true); } else { wv.getSettings().setPluginState(PluginState.ON); } String venkat="<iframe src=\"http://player.vimeo.com/video/27244727?portrait=0&color=333\" width=\"WIDTH\" height=\"HEIGHT\" frameborder=\"0\" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>"; wv.loadData(venkat,"text/html","UTF-8"); } }
在谷歌研究之后,我写了上面的代码,但没有工作.在这个没有错误发生,但是当我点击播放按钮进度条显示一段时间,然后它消失并再次显示播放按钮…有人可以建议我如何解决这个问题?
解决方法
做这个:
<iframe src="//player.vimeo.com/video/VIDEO_ID" width="515" height="340" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen> </iframe>