Reputation: 3672
We're trying to combine HTML and Flash in a packaged mobile app. It needs to work on Android and it would be nice if it worked on iOS as well. One option is to use AIR with an SWF root containing a StageWebView, which should work, but we'd prefer to have the root of the app be in HTML and loading the SWF content as needed. Is there a way to do this by, for example, using Phonegap/Cordova or similar, perhaps with a plugin?
Upvotes: 2
Views: 2158
Reputation: 7520
If you want to have HTML as a root, it means that you will run Flash Player as a plugin. Since 2012, Adobe stopped supporting Flash Player for mobile. Which means that it can be done easily - as just embedding your swf into HTML page, BUT it won't run on almost any device. That's because the player must be installed as a plugin for the browser. What you want is to embed the swf just like you're doing it on your desktop, and pray that the browser has it installed and run it. Nowadays most of the devices do not support it.
There isn't any easy workaround, because of the fact that Adobe cut the rope. And it's the proper way that should be done, as that Flash would be a part of an HTML. It won't have access to any hardware nor it would have permissions for writing and things like that.
So if you want Flash inside mobile, it's almost certain that it must be within AIR - it's native wrapper.
And the short answer basically is - yes, just embed it as swf inside HTML, but it won't work on much devices :)
Upvotes: 2
Reputation: 1579
That's not possible. There's no plugin support for IOS.
The android situation only is slightly better since Adobe stopped publishing the plugin after/with Android 4.2. Older devices that have the plugin installed would work, the rest wouldn't. Also Adobes usage terms for the plugin wouldn't allow you to bundle it with your application if they didn't completely changed it since I checked it some years ago.
There are some solutions that might be providing you with what you look for some day, but they are not ready yet IMHO. Still, here some links:
That means right now Air is your only serious option if you want to combine Flash and HTML on the same mobile device.
If you are still in the planning phase of your project or willing to rework the code you could also evaluate Haxe/OpenFL which is NOT FLASH but would allows you to develope your application with the Haxe language (similar to AS3), work with a Flash like display model - and then export the project as HTML5, SWF (also Air) or native Mobile applications for IOS/Android:
Upvotes: 3
Reputation: 61
I want to warn you that mobile webView has a lot of issues and limitations. As for me it is extremely bad idea to put flash player inside mobile webView (it looks like the castle in the swamp). AIR as root application is definitely better solution (but anyway StageWebView brings a lot of pain too, it is just wrapper around native webView afaik).
Well, but if your choise is HTML, try to patch cordova\phonegap template (find there CordovaActivity class) to enable flash content as following:
WebSettings settings = appView.getSettings();
settings.setPluginState(PluginState.ON);
Upvotes: 1