Camera class in Media package

There does not seem to be an OpenFl equivalent of the flash class Camera in the Media package. This allows access to the client’s system or device camera.

I’m converting a Flash action script project that imports an image from the user’s built-in camera. It relies on flash.media.Camera to do this. Are there OpenFl classes that can do this? Are there any OpenFl based classes that can do this?

There’s this lib for OpenFl on html5 target:

1 Like

Thanks. Are there any example projects that use openflCamera? Is there documentation about the variables and functions defined in openflCamera?

Installed it but running into a few problems.
This line in function ondevicechange(e:Dynamic) generates an error:

Timer.delay(() -> {findAvailableDevices(findDevice);}, 100);

I don’t know what ondevicechange is for so for now I’m commenting it out.

Another problem is that the Flash Actionscript sample I’m using has these lines:

camera = Camera.getCamera();
video=new Video(camera.width, camera.width.height);
video.attachCamera(camera);

openfl.media.Video does not have a attachCamera function. So I’m not sure how to fix that.

I’m hoping we can focus in on some of these HTML5-only features soon

Features like this have been held back because we’ve had a native/mobile-first philosophy (in general) where if it is not implemented there we leave it out of HTML5 as well. I’d like to start emphasizing HTML5 first especially since some of these missing features are just low-hanging fruit