Gets information about the specified camera.
$m.getCamConfig(function(response) { if(response.code){ // see if the rear camera has a flash juci.controls.get("flash-available").value(response.result.flash); } else{ // show error as toast message. $m.toast(response.error.message); } }, $m.CAM_REAR); |
Syntax
$m.getCamConfig(cameraType[, fp_callback])
Parameters
cameraType
number (optional)
Type of the camera which configuration is needed. Possible values are
- $m.CAM_REAR - Rear camera. Default.
- $m.CAM_FRONT - Front camera.
fp_callback
function (optional)
Function that is invoked when the camera configuration is read. The function receives a response object as parameter with the following properties,
- result - {Object}. Configuration object that contains properties,
- flash - {Boolean}. Tells if the specified camera has a flash.
- resolutions - {Array}. Contains array of supported resolutions by the camera. Each resolution object contains width and height properties. Supported in Android, Blackberry and Windows Phone only.
- type - {Number}. Denotes the type of camera, will be either of $m.CAM_REAR and $m.CAM_FRONT.