Does OpenFL/Haxe play video in iOS & Android?

Hi everybody,

I tried the PlayingVideo example of the openfl package, but it does work in iOS (even after some tweeking attempts). I just get a white screen. Do I miss something here?

OpenFL API Reference shows that openfl.media.Video and openfl.net.NetStream.play() are “Available on all platforms”. From searching in the Internet and forums, iOS/Android native video for openfl (and Haxe) seem to be a big roadblock for a lot a people in many years, and it is not clear if that has been solved.

Was anybody able to get video playing in iOS & Android? What did you use, NME with StageVideo, WebM, openfl workaround, …? How did you do it?

I really appreciate if you could share your workflow for video for iOS/Android. I am sure that many developers will love to here from you too!

Thanks!

Bruno

=======

Commands that I used for PlayingVideo example:

openfl create PlayingVideo
cd PlayingVideo
openfl test ios

This builds the project all right. The works on the attached iPhone to the Mac and simulator. I am able to place traces and breakpoints in xCode. All good, but it does not seem to get the events netStream (e.g. netConnection_onNetStatus_dyn). Nothing appears on the white screen. I tried both local .mp4 and remote .mp4, but it does not play.

=======

I have made several openfl applications using Videos but all in html5 and embedded with Cordova.
Did you also try the StaveVideo?

Hi Loudo, I tried and was able to get openfl to play video with HTML5 and Flash, but I also need native iOS and Android. I have not tried NME with StageVideo yet, because I would prefer to adopt openfl in our projects instead of moving to NME, but I may need to try that path… Thanks!

One day someone will build – https://github.com/FFmpeg/FFmpeg/blob/master/fftools/ffplay.c as a “native extension”. You know, proof of concept I made some time ago proved it is possible.

You can use ffmpeg in commercial apps – https://video.stackexchange.com/a/14804

1 Like

Hi Dimous, building ffmpeg in OpenFL is a great idea, and that seems possible on the business side based on the links that you posted. That will be indeed a great addition to OpenFL. Thanks!

One thing that I don’t understand is why OpenFL/Lime does not make use of the video playing capabilities inherent in each platform (iOS/Android). That is free to use because Apple/Google has already the license for the codes, etc. For mobile, which is really important, using iOS/Android existing libs that could be a great solution…

1 Like

To ensure the conditions of the FFmpeg license are met, without forcing OpenFL projects into the GPL/LGPL license, it must be referenced as a separate binary (dynamically linked library for example).

I’ve used FFmpeg in the past as a native process (executable external to my app), to avoid that issue. That was for encoding purposes only though.

Hi Bink, thanks for your post. Yes, tit would be great to use a separate lib and somehow use the capabilities of a video player - perhaps using an haxe extension - and hopefully leveraging the native video playing capabilities.

I wonder if somebody in the community was capable of doing that - for example implementing a haxe extension to play video using a native framework of iOS or Android. Anybody?

Thanks!
Bruno

Consider creating feature request on github. Maybe Joshua himself would implement it.

Also, offering a bounty is a common practice in haxe community to quicken things a bit.

OpenFL uses the browser on HTML5 or currently Lime on native/mobile platforms to implement lower-level features such as video support.

Once Lime has video support OpenFL can support it quite quickly. Happy to discuss video support in Lime and work with anyone spear-heading that effort.

to that effect Lime has a version of webm compiling but no API to support it yet

3 Likes