Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Reply
Contributor
underLabs
Posts: 37
Registered: ‎11-29-2010
My Device: Not Specified

Access to Camera through AIR

I just watched the Adobe Max lectures concerning the Playbook. Though, while they have clearly stated I do have access to any of the cameras (front/back), I have tried this:

private function getCamera(e:MouseEvent):void {
cam = Camera.getCamera();
if (cam){
     _trace.text = "ok - Camera is there";
} else {
_trace.text = "No camera here  ";
}
}

I always get: No Camera here! Plus, I'm curious to know how would be able to test the Camera through the Simulator.

Please use plain text.
Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: Access to Camera through AIR

the BB SDK is not fully done yet, so some of this is still TBD.

 

The Camera.getCamera static method has a name arguement.  I would assume the BB SDK would define some static variable as "front" and "back" to get the proper camera.

 

If you're running the application as an AIR application and you have a camera on your computer, you should be getting that.

 

Multimedia devices (camera, speakers, etc.) are not yet functional on the simulator.

 

Camera.names also returns an Array of available cameras on your computer, so you might want to send those to trace(...) to see what you have.

 

See more here:

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/media/Camera.html

 

Hope that helps.

 

 

Please use plain text.
New Contributor
rajubitter
Posts: 4
Registered: ‎11-22-2010
My Device: BlackBerry Table OS Emulator

Re: Access to Camera through AIR

Will the camera access be a Blackberry/Tablet OS specific API? Or will that be aligned/compatible with the AIR for Android API?

Please use plain text.
Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: Access to Camera through AIR

I would have to assume it will use the standard Camera class.  QNX items are usually (typically at this point) controls that are either highly optimized for the platform (eg HTML control) or standard controls that behave better with touch manipulation.  However, since this is still beta, that could change, but I would doubt the Camera API would.

Please use plain text.