正在实施一个电影应用程序。因此,使用 iframe 嵌入 youtube。它在大型设备中工作,但在移动设备中它在流式传输后显示黑屏?请帮我
this.webview.getSettings().setJavaScriptEnabled(true);
this.webview.getSettings().setBuiltInZoomControls(true);
this.webview.getSettings().setJavaScriptCanOpenWindowsAutomatically(false);
this.webview.getSettings().setPluginState(WebSettings.PluginState.ON);
this.webview.getSettings().setSupportMultipleWindows(false);
this.webview.getSettings().setSupportZoom(false);
this.webview.setVerticalScrollBarEnabled(false);
this.webview.setHorizontalScrollBarEnabled(false);
final String mimeType = "text/html";
final String encoding = "UTF-8";
String html = getHTML();
webview.loadDataWithBaseURL("", html, mimeType, encoding, "");
和:
public String getHTML1() {
Log.d("trailer_2 HTML", "ok");
String html1 = "<html><head><meta name=\"viewport=target-densitydpi=device-dpi\" content=\"width=320"
+ this.frame_width
+ ", height"
+ this.frame_height
+ ",initial-scale=1.0, minimum-scale=1.0,user-scalable=no\"/>"
+ "</head>"
+ "<body style=\" background:transparent; margin: 0; padding: 0\">"
+ "<iframe class=\"youtube-player\" style=\"border:0; width: 100%; height:100%; padding:0px; margin:0px\" id=\"ytplayer\" type=\"application/x-shockwave-flash\"allowscriptaccess=\"always\" allowfullscreen=\"true\" src=\"http://www.youtube.com/embed/"
+ "H7Ht-m2QMDY"
+ "?fs=0\" frameborder=\"0\">\n"
+ "</iframe>\n";
return html1;
}
在清单中我提到android:hardwareAccelerated="true"
和<uses-permission android:name="android.permission.INTERNET" />
..提前致谢