As far as I know this isn't built into the Android API directly. However, you can use PhoneGap, which provides Javascript hooks into native device functionality (i.e., the camera).
You can view a list of supported features here, and read their Camera API documentation here.