Quantcast
Channel: Adobe Community : All Content - AIR Development
Viewing all articles
Browse latest Browse all 2954

Crash on "video.attachCamera" with front camera (S3, Android)

$
0
0

Hi,

 

I'm developing a camera app with Adobe Air (version 15.0.0 build 302). I would appreciate any help with this really weird bug that I found.

 

In the Samsung S3 device, attaching the front camera to a Video instance always results in the app crashing. After the crash, the camera becomes unusable by any app on the device. The device must be reset in order to restore the camera. After many tests, I know that the app crashes when the "video.attachCamera" method is called.

 

This is the relevant piece of code:

 

this.cameraPos = CameraPosition.FRONT;

this.camera = this.getCamera(this.cameraPos);

this.camera.setMode(640, 640, 30);

this.video = new Video(640, 640);

this.video.attachCamera(this.camera); // crash!

 

private function getCamera(position:String):Camera

{

  for(var i:int=0; i<Camera.names.length; i++)

  {

    var c:Camera = Camera.getCamera(String(i));

    if(c.position == position) return c;

  }

  return Camera.getCamera();

}


The same code works fine in other Android devices. Listing all available cameras show that both (back and front) cameras are available in the S3. And the front camera works fine when I use CameraUI.

 

Any help will be much appreciated.

 

Thanks in advance!


Viewing all articles
Browse latest Browse all 2954

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>