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
spoutnik
Posts: 38
Registered: ‎07-06-2012
My Device: DevAlpha, PlayBook
My Carrier: BaseDE, BouyguesFR
Accepted Solution

using camera in AIR SDK Beta 10

Hi,

I am trying to port my playbook air app to the BB10 sdk. It seems rather easy. But I have a problem accessing the camera. I wonder if it is a bug or a missing feature of the current beta.

 

The way I acces the camera is quite standard:

var camera:Camera = Camera.getCamera();

...

camera.setMode( 800, 400, 15, true );

var video:Video = new Video(camera.width, camera.height);

video.attachCamera(camera);

addChild(video);

When I debug I get the camera object but it does not stream anything (fps=0). 

 

Thank you for your help,

Toby

Please use plain text.
Contributor
spoutnik
Posts: 38
Registered: ‎07-06-2012
My Device: DevAlpha, PlayBook
My Carrier: BaseDE, BouyguesFR

Re: using camera in AIR SDK Beta 10

I fixed it! In fact I used

camera.setMode(1024,600,15) 

when changing to another mode the camera picture shows up correctly.

Please use plain text.
Developer
shaan_softwaredvlpr
Posts: 172
Registered: ‎01-17-2011
My Device: 9500 series
My Carrier: Airtel

Re: using camera in AIR SDK Beta 10

Either you can use CameraUI class to access video as well as Images from Camera.

 

private var myCam:CameraUI;
myCam = new CameraUI();
myCam.addEventListener(MediaEvent.COMPLETE, onAddImageFromCamera);
myCam.launch(MediaType.IMAGE);
or
myCam.launch(MediaType.VIDEO);

 You can have both modes , with zoom front camera access by using it.

You also need to add permission for it.

 

Please use plain text.