我尝试了以下代码:
WebView wv = (WebView) findViewById(R.id.webView1);
String playVideo= "<html><body><iframe width='200' height='143' src='http://www.youtube.com/embed/JW5meKfy3fY' frameborder='0' allowfullscreen></iframe></body></html>";
wv.getSettings().setPluginsEnabled(true);
wv.getSettings().setAllowFileAccess(true);
wv.getSettings().setPluginState(PluginState.ON);
wv.getSettings().setBuiltInZoomControls(true);
wv.getSettings().setJavaScriptEnabled(true);
wv.loadData(playVideo, "text/html", "utf-8");
我只看到了缩略图,当我点击它时,画面会变成黑色,无法加载视频。我正在针对API 15进行开发,并具有互联网权限。如何在Android webview中运行html5 YouTube iframe视频?