我使用这段代码将Vimeo播放器加载到WebView中:
WebView webView = (WebView) rootView.findViewById(R.id.web_view);
webView.getSettings().setJavaScriptEnabled(true);
String data = "<iframe src=\"http://player.vimeo.com/video/102234762\" width=\"350\" height=\"300\" frameborder=\"0\" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>";
webView.loadData(data, "text/html", "UTF-8");
这就是我得到的:
但是,当我点击播放按钮时,背景变为灰色且视频无法启动:
任何人都知道可能出现什么问题以及如何解决这个问题? 该代码在带有Android 4.2.2的Samsung S4上运行。