我试图在 webViewClient 中打开一个 SWF 文件,它适用于 Android 2.1 和 2.3.3。但是当我尝试在 4.0.4 上播放相同的 SWF 文件时,它会导致错误,并且在 videoPlayer 页面中出现绿屏。
oWebView = (WebView) findViewById(R.id.wvhPlayer);
oWebView.setWebViewClient(new KhWebClient());
oWebView.getSettings().setJavaScriptEnabled(true);
oWebView.getSettings().setPluginsEnabled(true);
oWebView.getSettings().setAllowFileAccess(true);
oWebView.getSettings().setBuiltInZoomControls(true);
String html = " <object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" width=\"100%\" height=\"100%\" id=\"vPlayer\" align=\"middle\">"
+ " <param name=\"movie\" value=\"http://mysite.com/sites/all/modules/player/player.swf?id=0CYj9tI0hpQ"
+ "\" />"
+ " <param name=\"quality\" value=\"high\" />"
+ " <param name=\"bgcolor\" value=\"#000000\" />"
+ " <param name=\"play\" value=\"true\" />"
+ " <param name=\"loop\" value=\"true\" />"
+ " <param name=\"wmode\" value=\"window\" />"
+ " <param name=\"scale\" value=\"showall\" />"
+ " <param name=\"menu\" value=\"true\" />"
+ " <param name=\"devicefont\" value=\"false\" />"
+ " </object>";
oWebView.loadDataWithBaseURL("null", html, "text/html", "utf-8", null);