How to work with Camera API in Firefox OS

I want to work with api camera in firefox os simulator. Documents show that it is only available for certified applications. If I want to take a picture with the camera in my application, how can I continue developing the application? thanks in advance

+7
firefox-os
source share
2 answers

To take pictures, you must use the web operations API . Simply put, this is the equivalent of Android Intents for Open Web.

I would write a lot about this, but there are good code examples, like this one , implementing just that. You have a few things:

Create web activity:

 var recordActivity = new MozActivity({ name: "record" }); 

Define the onsuccess and do whatever you want with the result:

 recordActivity.onsuccess = function () { console.log(this); } 

There are a few more details, and they are all listed on this post in Hacks .

+8
source share

So, some things have changed last year. Web actions are still suitable for most applications, but we have two APIs that have not been previously shown.

From Firefox OS 1.4, you have access to getUserMedia so you can get a direct stream of the camera. From Firefox OS 2.0, you now have access to the mozCameras API, which allows you to use things like camera switching and flash control.

+1
source share

All Articles