hi all
I have developed in Adobe flash and AS3 for many years
now I am starting a new project which targets android and iOS mobile devices
this project has heavy animations and graphic effects which makes openfl suitable for it
but I cant figure out if it fulfill all my needs
there are two important parts in my project which I dont know how to do it with openfl
an online videoplayer which plays stream from net
a webview to open local simple downloaded JS gams and apps
if you have any experience in impenting these in your openfl project please help to see is it possible or not.
Haxe language is more than capable. I am unsure if openfl has the best video support on android via hxcpp, but I maybe wrong. you may find currently that compiling to flash and using Harman AIR will give best or use haxe js and nodeJS and electron on android, but it’s not native so can be big. If you put the effort in then I think that haxe and openfl are more than capables but you may need to do lots of research and work.
I personally think that heavy animations and graphic effects are red flags for any canvas based html5 based project. Not just Open fl.
It may skip the frames, look jerky, may take a lot of CPU and can even crash the browser. You may need to simplify your animations. Or even ignore using them in some cases.
I dont want to run whole application in html 5
the application will be compiled native for iOS and android
but I have some simple minigames developed in html5 and I want to run them in webview inside my app
Web view is same as browser. And browsers do run html5 canvas great. But when it comes to heavy animations, the combination of browser + mobile , causes the issue. Both the factors are sensitive to high CPU usage. In addition, browsers and mobile phones are bad in running audios too.
Do you have example of the animation you want to run ?
As I said my html5 games are so simple. like every toddler game. like matching colors or other simple games. I have tested my games in browser and they are ok
the heavy animation I mentioned is in my UI, when user clicks on play button, I want to open the web view and run that simple html5 game
I need to communicate with web view via JS or other ways
I know OpenFL is capable to do my UI in Native Mode, but I need to know if is it possible to play video and run simple html in web view or not
thanks
Unfortunately OpenFL does not support either out-of-the-box. There’s absolutely no implementation of any kind of webview, and although there’s a stub for a Video object, judging from its source code it only works on JavaScript/HTML5 target (I personally never tried or used it)
You might have some luck checking out relevant Haxe libraries (haxelibs, webview and video), but keep in mind that many of these libraries are decade old, and possibly not maintained anymore (although they might work, you’ll probably have a difficult time working with them or asking for basic support if something breaks).
I’m working with Haxe and OpenFL since quite a while, and although it has a great team around it, they always prioritized cross-platform compatibility first, and I guess somehow both fields you’re looking for (webview and video, especially streaming media) were kinda difficult to add and maintain throughout the years.
Give haxelibs a try, maybe you’ll find a working solution, if you can add a wokring/usable webview, you might be able to display streaming video in that webview as well.
gepatto recently shared a video of a native OpenFL app on a Raspberry Pi running video with the hxvlc library. hxvlc says it supports Android and iOS too, so that may be your best bet for video.
There is a WebView extension available at the link below. It hasn’t been updated in several years, but it may be worth checking out.