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