The XwalkView version are crosswalk-webview-10.38.235.0-arm

From: Crosswalk-help 
[mailto:[email protected]] On Behalf Of Cao, 
Jenny Q
Sent: Tuesday, November 4, 2014 10:13 AM
To: Kevin Moreland; [email protected]
Subject: Re: [Crosswalk-help] Unable to access the environment camera after 
Android has called camera.unlock()

Kevin
We tried to use XwalkView() to load a JS with getting the camera via 
getUsermedia API.
The camera can be called.
You could reference Our JS code:
        try {
            navigator.getUserMedia = navigator.getUserMedia || 
navigator.webkitGetUserMedia;
            navigator.getUserMedia({video: true}, function(s){
                var url = webkitURL.createObjectURL(s);
                $("#localView")[0].src = url;
                $("#localView").show();
                $("#errormassage").hide();
               }, function(error){
                $("#errormassage").show();
                $("#errormassage").html("Get user media occur error:<font 
color='red'>PERMISSION DENIED</font>");
            });
        } catch (e) {
            $("#localView").hide();
            $("#errormassage").html("Get usr media occur error,with error 
message:<font color='red'>"+e.message+"</font>");
        }
Thanks
Jenny

From: Crosswalk-help 
[mailto:[email protected]] On Behalf Of Kevin 
Moreland
Sent: Thursday, October 30, 2014 10:47 PM
To: 
[email protected]<mailto:[email protected]>
Subject: [Crosswalk-help] Unable to access the environment camera after Android 
has called camera.unlock()

Before launching an embedded xWalk view (crosswalk-webview-10.38.225.0-arm), 
I'm grabbing a camera reference for the rear(environment) camera in order to 
turn the LED on in torch mode.

In the Android activity:

...

rearCamera = Camera.open();
rearCamParams = rearCamera.getParameters();
rearCamParams.setFlashMode(Parameters.FLASH_MODE_TORCH);
rearCamera.setParameters(rearCamParams);
rearCamera.startPreview();
rearCamera.unlock();

and the JS in the HTMLl that is being loaded by the XWalkView:

...

if(sourceInfo.kind == "video" && sourceInfo.facing == "environment") {
          videoSourceId = sourceInfo.id;

...

navigator.getUserMedia({audio: true, video: {optional: [{sourceId: 
videoSourceId}]}}, function(stream){
                                  $('#my-video').prop('src', 
URL.createObjectURL(stream));


The following errors are emitted by chromium:

10-30 10:35:21.008: E/VideoCapture(23490): allocate: Camera.open: 
java.lang.RuntimeException: Fail to connect to camera service

10-30 10:35:21.008: E/chromium(23490): 
[ERROR:video_capture_device_android.cc(193)] 
VideoCaptureDeviceAndroid::SetErrorState: failed to allocate


Ideally, I'd like to be able to turn on the rear camera LED light by adding a 
property to the video object in JS or using unlock method to allow Crosswalk to 
access the camera.

Is there another way to accomplish this? Any assistance would be greatly 
appreciated,

Kevin
_______________________________________________
Crosswalk-help mailing list
[email protected]
https://lists.crosswalk-project.org/mailman/listinfo/crosswalk-help

Reply via email to