My application makes use of the device's camera. The user can open and close the camera at any time. When the camera is first opened, the rear camera is selected and flash is turned on. Using the standard camera interface, the user is able to swap to the front camera or disable flash. The next time the user opens the camera, however, their settings have been reset to the default.
Is there a way to remember what camera settings the user selected without using a custom camera overlay?
My initial thought was to listen for events from the camera. If the user changes the camera (from rear to front), save that preference into a variable. When the user opens the camera again, look at that variable to determine which camera to show.
I haven't found any documentation for such camera events, though. Surprisingly, I can't find any API documentation for Titanium.Media.switchCamera either. Is that function supported?
1 Answer
if (Ti.Media.camera == Ti.Media.CAMERA_FRONT) { cameraType.title = "front"; Ti.Media.switchCamera(Ti.Media.CAMERA_REAR); } else { cameraType.title = "rear"; Ti.Media.switchCamera(Ti.Media.CAMERA_FRONT); }from camera_video.js in KitchenSink
Your Answer
Think you can help? Login to answer this question!