[2.0] Stable Simulator crashes using CameraManager.getCamera()

RESOLVED WONTFIX

Status

Firefox OS
Gaia
RESOLVED WONTFIX
4 years ago
4 months ago

People

(Reporter: André Fiedler, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

4 years ago
I'm trying to execute this script on stable Simulator 2.0:

> var options = {
>   mode: 'picture',
>   recorderProfile: 'jpg',
>   previewSize: {
>     width: 352,
>     height: 288
>   }
> };
> 
> function onSuccess(camera) {
>   console.log('camera');
> };
> 
> function onError(error) {
>   console.log(error);
> };
> 
> navigator.mozCameras.getCamera('back', options, onSuccess, onError);

It will always crash the Simulator. The webapp.manifest has all required permissions. MDN mentiones that I can used CameraManager.getCamera() with Firefox OS 2.0
(Reporter)

Comment 1

4 years ago
@Mike Habicher: I saw that you are working on the CameraManager. Do you know if the Camera API works at all on FxOS 2.0 Simulator (stable) in privileged apps?
Flags: needinfo?(mhabicher)
André, that's because bug 1107683 removed the callbacks from the CameraControl methods in favour of returning Promises. You can see how Firefox OS's Camera app handles this method below:

https://github.com/mozilla-b2g/gaia/blob/master/apps/camera/js/lib/camera/camera.js#L188

That said, it shouldn't CRASH the simulator. Are you actually seeing a crash, or just the script failing? Can you attach the logcat output to this bug?
Flags: needinfo?(mhabicher) → needinfo?(andre.fiedler)
(Reporter)

Comment 3

4 years ago
It did CRASH the Simulator 2.0 reproduce-able on Windows. Let me check tomorrow at work.

How can I get the logcat output from the Simulator on Windows?
Flags: needinfo?(andre.fiedler)
Just to clarify: do you mean the emulator (QEMU pretending to be an ARM SoC, running ARM code) or the simulator (a version of Firefox running x86 code but pretending to be Firefox OS)?

If the former, you can run |adb logcat -v threadtime| to dump the logcat output. I'm not sure about how to get logging for the latter.
(Reporter)

Comment 5

4 years ago
I'm talking about the Simulator, one of those you can install using the Firefox WebIDE.
-> ftp://ftp.eu.mozilla.org/pub/labs/fxos-simulator/index.html

Comment 6

4 months ago
Firefox OS is not being worked on
Status: NEW → RESOLVED
Last Resolved: 4 months ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.