4

Recently I found an interesting thing is that Flash still works on firefox android 4.4 and there actually an firefox view(geckoView) that we can replace the webview. I followed the demo here and Orfox here Basically, I can build the app which uses geckoview to render flash content on Android 4.1 but not 4.4 (Kitkat).

On Kikat it says

Please install or enable Adobe Flash Player to view this content

There is a preference in firefox

PrefsHelper.setPref("plugin.disable", false);

this will toggle the flash plugin in firefox but that preference doesnt when I put it in Orfox.

I want to know which preference to enable flash on Geckoview? Or in general how to enable flash on geckoview android 4.4

I know flash is almost dead due to its poorly performance and support on mobile but there are still plenty of video contents are still in flash and we want to have flash support on our app

Some snippets and images in case you want to see

@Override
protected void onCreate(Bundle savedInstanceState) {
        setContentView(R.layout.activity_main);

        mGeckoView = (GeckoView) findViewById(R.id.gecko_view);

        mGeckoView.setChromeDelegate(new MyGeckoViewChrome());
        mGeckoView.setContentDelegate(new MyGeckoViewContent());
}
private class MyGeckoViewChrome extends GeckoViewChrome {
        @Override
        public void onReady(GeckoView view) {
                 PrefsHelper.setPref("javascript.enabled", true);
                 mGeckoView.addBrowser("http://www.dhs.state.il.us/accessibility/tests/flash/video.html");
        }
}

Firefox and Orfox with GeckoView

Update 1: After a day of digging into Firefox android source code, I think the question now is more like "How can we enabble plugin in GeckoView". I try to access "about:plugins" I see Flash hasnt been added while it has in 4.1 and Firefox(4.4). There is a method in GeckoAppShell thats locate flash library libflashplayer.so and it can actually find the lib. Not sure why it cant be loaded

Cuong Thai
  • 1,165
  • 1
  • 11
  • 24

1 Answers1

2

I am able to run flash file(swf) in GeckoView. I am not sure how did you import the jar file in your project but follow the instructions to work it properly.

  1. Download geckoview_library and assets
  2. Extract geckoview_library.zip and add the project as a lib project.
  3. Extract geckoview_assets.zip and copy all the contents in your project's assets folder.

Now you can follow the example code here.

Note: You must have to install Adobe flash plugin for android. Install manually from here

shantanu
  • 2,408
  • 2
  • 26
  • 56