Camera question

androb

Member
Licensed User
Longtime User
I have been experimenting with my app that I want to use to take photos and video and upload to a server. I first got video working and I am able to record a video using the Camera library.

All good so far, but, when trying to add in still image function, I have problems. It seems that the camera can only be in one particular mode in an application, by this I mean you can set it to be a still camera OR a video camera, but not switch between the two functions during the application.

Is it possible for me to have a button inside the app that I can click to take an image and a button to click to record a video, without it freaking out and telling me the camera is in use?

Just to show what I am using, the function to record is :

B4X:
videoRecorder.Record(File.DirRootExternal, filename)

to record a video.

I used code from the camera example, which contains this (among other lines)

B4X:
camEx.Initialize(Panel1, frontCamera, Me, "Camera1")
frontCamera = camEx.Front

I suspect it might be to do with the way that I am not properly "freeing" the camera after recording video or an image.

If I go into my app, select still image, take an image it works.
If I then choose record video in my app, it says the camera is in use


Then....I close app, and do the reverse:

choose record video, it records
select still image, it says camera is in use

Individually the features work but not together. I am not sure how or where I should be "Freeing" the camera up after using it, so that I can change the mode.

Any help is appreciated.
 
Top