问题
What is the right way to view .Swf files that plays .Flv videos in Android? The code that I am using right now to enable Flash support in web view is
WebView mWebView = (WebView) findViewById(R.id.webview);
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.getSettings().setAllowFileAccess(true);
mWebView.getSettings().setPluginsEnabled(true);
mWebView.getSettings().setSupportZoom(false);
mWebView.getSettings().setAppCacheEnabled(false);
mWebView.getSettings().setAllowContentAccess(true);
mWebView.getSettings().setCacheMode(mWebView.getSettings().LOAD_NO_CACHE);
For the HTML file, I'm using swfObject.
The problem is that I can open up the SWF file just fine from third party apps like SWF Player from the market. In addition, I can load up the HTML page from the browser by calling it directly through file:///. However, when I load it up using my webview, I'm stuck with a blank screen. Any tips?
Thanks.
回答1:
Have you got:
<application android:hardwareAccelerated="true"...
in your AndroidManifest.xml?
I had a similar problem on 3.2 and this solved it for me. 4.+ has this enabled by default (I believe).
D/.
来源:https://stackoverflow.com/questions/9381407/playing-swf-files-locally-from-android-webview