我试图通过调用loadDataWithBaseURL方法并传递给它嵌入数据来播放SWF视频。但视频不会开始播放,只显示白屏。我做错了吗?
protected void onCreate(Bundle savedInstanceState) {
// Get Web View from the layout.
mWebView = (WebView) findViewById(R.id.webViewOnlieWebCams);
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.getSettings().setPluginsEnabled(true);
mWebView.getSettings().setAllowFileAccess(true);
String mimeType = "text/html";
String encoding = "utf-8";
String embed = "<embed type=\"application/x-shockwave-flash\" src=\"/bundles/mymain/swf/player-licensed.swf\" width=\"320\" height=\"390\" style=\"undefined\" id=\"mpl\" name=\"mpl\" quality=\"low\" allowfullscreen=\"true\" allowscriptaccess=\"always\" wmode=\"opaque\" flashvars=\"autostart=true&file=camera39.stream&streamer=rtmp://wss.yerevan.am/axis&logo=/bundles/mymain/images/logo10.png&logo.hide=false&logo.position=bottom-left&logo.timeout=3\">";
mWebView.loadDataWithBaseURL(null, embed, mimeType, encoding, "");
}
答案 0 :(得分:2)
尝试使用以下代码:
String html = "<object width=\"1008\"height=\"550\"> <param name=\"movie\" value=\"file://"
+ path
+ "\"> <embed src=\"file://"
+ path
+ "\" width=\"1008\"height=550\"> </embed> </object>";
String mimeType = "text/html";
String encoding = "utf-8";
web.loadDataWithBaseURL("null", html, mimeType, encoding, "");