Playing SWF files locally from Android Webview

馋奶兔 提交于 2020-03-06 03:52:05

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!