Get back to camera after taking photo (and saving photo to photo library)

This is baffling. Rob, can you explain why you put this code:

timer.performWithDelay(10, function() media.capturePhoto( { listener=onComplete } ); end )

Inside the call-back function for media.capturePhoto?!?!? It looks like media.capturePhoto will cause infinite looping!

Please explain what’s going on here! I am having camera trouble, too.

Hey @mimetic, the previous poster wanted the camera app to fire back up immediately after taking one photo like the default camera app behaves.  Our control is more like one you would use for social networks were you take one photo then your app does something with the photo.  So in effect, it is infinite looping.   It’s done in a timer because when you try and call something thats in the middle of handling an event you sometimes need to give the listener a chance to complete.

Rob

Aha. Thank you.

Can you clarify your camera control? I am using object.fill to make a live view of the camera, but when I use media.capturePhoto to take a picture, the live view stops. I think it might resume if I had other objects on top of the live view that had enterFrame events, but that shouldn’t be necessary.

I’m using display.setDrawMode( “forceRender” ), but that isn’t sufficient.

I’m not sure I can since I’m not building a camera app.  As for the issue you are running into, I suspect it’s two separate processes fighting for control of the camera.  The media.capturePhoto() is using an OS control to handle the camera and I’m guessing that its interfering with our direct access to the camera.  In face I’m surprised that media.capturePhoto() works at all with the app already using the camera.  I don’t know if our object fill use of the camera can be hardened or not.  We added it as an experiment and to mess around with Augmented Reality.  I don’t think it was conceived to build a functioning camera app.  It’s pumping a video feed into the fill and isn’t designed for photo capture.

Rob

Rob, I guessed it was pushing a video feed in. However, it’s the only way to have a live-view camera. And, yes, you can build a camera out of it (with lo-res and poor quality), but good enough for kids.

I wanted to offer the ability to take a real photo to get better quality — if I could simply “fire” the camera without using the built-in interface, that’d cool, because then I could use my live-view (with a grid, etc.), but fire off real photos.

-D