getCamConfig

Camera

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

  1. $m.CAM_REAR - Rear camera. Default.
  2. $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,

  1. result - {Object}. Configuration object that contains properties,
  1. flash - {Boolean}. Tells if the specified camera has a flash.
  2. 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.
  3. type - {Number}. Denotes the type of camera, will be either of $m.CAM_REAR and $m.CAM_FRONT.