Camera app

(simon g) #1

Hello , I put my draft version of camera app on Github
For the moment, I exclusively use standard JS ( I know it could not just make with standard JS )

What I need to do ( in most case, I’m searching if there a way to make it with standards API ) :

  • Add Flash ( For automatic flash, is there a light sensor or we make a light average of the image ? )
  • set focus ( on previous version of camera we could touch a part of the image and it focus on it , I think we’re far to be able to code it with standards API :confused: )
  • get informations on camera ( by default, I supposed I get the max video definition, but in general, there is a photo max definition which is better than the video max definition )
  • switch of camera ( I know it’s possible in standard API )
  • make video in 3gp ( it’s possible that’s depend of the device and its libs )
  • put directly files on the filesystem and not download it ( and then manipulate it in the gallery )
  • make the manifest to turn it in app

This version could run on desktop browser to test , for the moment , there is no Icon, but letters Mode (M to switch Photo < - > Video ) , Photo (P at middle on the bottom) , Parameters (P top right) , Record (R when you switch mode) , Stop (S when you’re recording) , and the app will send you the video or photo when you make it .

(Lapineige) #2

ping @benfrancis :slight_smile:

Thx @sizvix ! :slight_smile:
Did you tried it on B2G, or with Mulet ?
Mulet can be a good first step to convert it, with manifest, storage (and not download)…
When there is no standard API we might need to convert it to chrome.

Are you re-using the previous camera code, or are you starting from scratch ? Maybe you can use it, or some of the assets, to build the UI faster.

(Sai Karthik) #3

Nice work! :smiley:

(Jovan Gerodetti) #4

may i ask why you started from scratch instead of simply fixing the existing app?
We waist a lot of time and energy with all these re implementations. :neutral_face:

(simon g) #5

We said we must use the most standard code possible, and JS standards has change a lot those years , so we can use more standards code , and the better way ( I think ) to do it , is to recode the app firstly with standard code.

(Jovan Gerodetti) #6
  1. there is no Camera API, yes we have media APIs for video and audio streams from the users hardware, but those are not camera APIs.

  2. It’s not about rebuilding everything from scratch. We should try to replace every broken API in existing apps. We will waste our time with recreating UX if we rebuild everything.

  3. Yes we want to turn most parts of Gaia into WPAs, but at first we want to deliver the same UX as before. That means we should build our software with the possibilities we have right now. That includes to declare former Gaia apps as B2G system chrome and use gecko chrome only APIs.

(simon g) #7

I’m trying the way of debugging the original app … But it not seems easier ^^U
I’m not sure I’m on the right way, the original app did nothing, because it never execute

define( function( require ) { … } )

so , I’m replacing the require by standard export / import ( what about lazy import ? )

(Lapineige) #8

Some links that can be interesting:

(Thanks to brieucs, a French Firefox OS user, for the links ;))

(simon g) #9

I tried to port the old Camera app to the new system, but I didn’t succeed …
So I try to use my draft with Camera API , because we need Camera API, standard from W3C didn’t have flash, focus, camera capabilities … But nothing work … I can’t use Camera API … The smallest exemple from the documentation doesn’t work … Someone succeed to use the camera API with B2G ?
I’ll update gecko again to retry …

(Fabrice) #10

What do you mean by “nothing works”? You need to give a more precise description of the error for people to help you.

(simon g) #11

I was more searching about someone who succeed to use Camera API , because there isn’t a lot of log, just :
Promise { : “pending” }
Exception { message: “”, result: 2147746065, name: “NS_ERROR_NOT_AVAILABLE”, filename: “”, lineNumber: 0, columnNumber: 0, data: null, stack: “”, location: null }
The exception is logged in the onError of the mozCameras.getCamera promise.

(simon g) #12

As I said on IRC/telegram #b2g ,
There the “bug” : , I don’t know if it could explain some changes in Camera API …
With the test “dev_apps/test-camera/” that is linked to the bug 1073017 , same error “NS_ERROR_NOT_AVAILABLE”, but in DXR, I didn’t find “CameraService.cpp” which is the main class of this bug …


Bug 1073017 has been suspended and the patches are not landed to repository. So, the “CameraService.cpp” is not exist.

The mozCameras API is still there in mozilla-central.

(Krz37) #14

Small update here, @TitanNano is also working on it as well at the moment but has very limited tine.

(Lapineige) #15

So there is 3 people trying to work on this app right now (@TitanNano @sizvix @charja13).
I don’t know if you work together, but it would be nice if you coordinate your work (especially if you can make/list bug reports to keep us updated and avoid overlapping of your efforts).

Thanks ! :slight_smile:

(Charja13) #16

Due to so many people are working on it I stopped, mine is still sitting as just a base framework still. If you or sizvix need some help or want some I’ll more than happy to lend a hand though. I just didn’t want to keep working on something I didn’t need to.