2

My Air android app does a simple check to see if camera exists, checking length of 'Camera.names'.It works fine on most devices but the Nexus 10 is taking 7-10 seconds to respond. I then get a black full screen when I attach camera. The camera feed is then visible ok. I've set camera permissions in the application descriptor file through Flash Air for Android interface. I'm using Air 3.5. I have also tried using stageVideo and get same issue. Takes a long time to get a response from the camera interface.

Below is my code:

if (Camera.names.length > 0)
{
    var cam:Camera = Camera.getCamera();
    var vid:Video = new Video;
    vid.attachCamera(camera);
    addChildAt(vid, 0);
}
Nazik
  • 8,696
  • 27
  • 77
  • 123
  • Should have said, it is only the first check that takes a long time, after that any interaction with camera responds well. – Steve Young Feb 15 '13 at 09:46
  • Does only Camera.names takes so long the first time, or any of the first "Camera" initializations. – Adrian Pirvulescu Feb 15 '13 at 12:57
  • any first time interaction with the camera - also did check using var cam:Camera = Camera.getCamera(); if (cam == null) etc.. same problem .. several seconds before get anything back. Should mention no problem with ipads using the same check. – Steve Young Feb 15 '13 at 13:06
  • can you maybe try to set the quality on the camera before attaching to video? cam.setMode(640, 480, 25); cam.setQuality(0,100); Here is an iOS sample http://stackoverflow.com/questions/6339398/how-to-increase-the-quality-of-the-camera-using-as3/6340091#6340091 – Adrian Pirvulescu Feb 15 '13 at 13:15
  • I'll give cam.setQuality(0,100) a try. I already do cam.setMode command. – Steve Young Feb 15 '13 at 13:22
  • tried and still have problem. I actually just check for the camera being there at the start of my app then don't attach the camera until user selects. So pretty sure its the initial handshake with the device that is slow ... maybe some security check by Nexus 10? Checked and air has embedded permission in the android manifest ok. – Steve Young Feb 15 '13 at 13:32
  • Yes... that could be a good approach.. testing camera on app creation complete. Maybe it is also an android OS issue. Do you run same android ver on all devices ? – Adrian Pirvulescu Feb 15 '13 at 13:33
  • Tested same build with Nook HD (7inch) with no camera (but does have cameraRoll) and response to test (negative) is fine (< 1 sec). Don't have another android device with camera available... anybody else have this problem with other android devices with cameras? – Steve Young Feb 15 '13 at 13:45
  • Just to mention I've reported this problem to Adobe Air team and they are investigating. Will post results. – Steve Young Feb 22 '13 at 09:06

0 Answers0