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

Native Development

Reply
Highlighted
Developer
Posts: 41
Registered: ‎11-17-2013
My Device: Blackberry Simulator 10.2
My Carrier: Telcel
Accepted Solution

Photo and Video capture in a single QML-based app

Hello everybody

 

I'm currently learning to use the Camera QML component, and I have already get to open the Rear camera, set some cameraSettings and take a picture.

 

Now I would like to add Video capabilities to this same app. I mean, I want to add a photo/video toggle button and switch between video and photo modes. The thing is that I don't know how to do so. I guess that I need a second Camera component, but to tell the truth I have no idea of how can I achieve this goal.

 

I will appreciate your help a lot, and hope you to let me know which is the approach you have followed in order to do what I want to do. Any tutorial or documentation link is also wellcome Smiley Very Happy

 

Thanks in advance guys!

New Developer
Posts: 6
Registered: ‎08-21-2009
My Device: Not Specified

Re: Photo and Video capture in a single QML-based app

I don‘t find good QML example on camera capture but you can start with BestCam example under Cascades-Community-Samples repo
Developer
Posts: 41
Registered: ‎11-17-2013
My Device: Blackberry Simulator 10.2
My Carrier: Telcel

Re: Photo and Video capture in a single QML-based app

Well, I had found the BestCamera app but it seems it uses the camera api (I think this is it´s name), and i't uses it for everithing. The problem is that, as I said above, I'm new on this stuff and to be honest I didn't understand how the app works with this api.

 

Precisely after cheking this app is that I came to here looking for a easier solution so, this is not what I want to start with.

 

I read that you have to first stop the viewfinder and after that you have to stop the camera. I think that I need two Camera objects as attached objects and create an configure one when the app starts, then when I want to switch between video and photo mode, I have to stop the current camera object and create the other one.

 

Another option that comes to my mind now is that I should only stop the viewfinder without closing the camera and then change the settings and sfter all start the viewfinder again.

 

I will try both options and come back with the results Smiley Very Happy

Retired
Posts: 749
Registered: ‎12-16-2008
My Device: BlackBerry Z30
My Carrier: Bell

Re: Photo and Video capture in a single QML-based app

BestCamera is all about showing you how to use the C Camera API in Cascades, since it lets you do a few things (like facial detection and burst capture) that aren't available in the Cascades Camera API.

 

You don't need two camera objects to switch between capture modes, just change the camera mode.

 

One thing that trips people up sometimes is the fact that you need the microphone permission in order to record video, which you don't need for simple pictures.

Paul Bernhardt
Application Development Consultant
BlackBerry
@PBernhardt

Did this answer your question? Please accept this post as the solution.
Found a bug? Report it to the Developer Issue Tracker
Developer
Posts: 41
Registered: ‎11-17-2013
My Device: Blackberry Simulator 10.2
My Carrier: Telcel

Re: Photo and Video capture in a single QML-based app

Thanks a lot!

 

I supose that if I want to switch between the front an rear camera I will need to close one camera, open the other one and apply the settings again, am I right?