Packagecom.distriqt.extension.camera
Classpublic final class Camera
InheritanceCamera Inheritance flash.events.EventDispatcher

Camera Native Extension Library

This extension creates access to native features of the Camera hardware giving you finer control over the camera and allowing you to create more complex imaging applications.

Key Features

Supported on the following platforms:



Public Properties
 PropertyDefined By
  canOpenDeviceSettings : Boolean
[read-only] Returns true if you can display the device settings for your application.
Camera
  implementation : String
[read-only] The implementation currently in use.
Camera
  instance : Camera
[static] [read-only] The singleton instance of the Camera class.
Camera
  isSupported : Boolean
[static] [read-only] Whether the camera is supported on the current device
Camera
  nativeVersion : String
[read-only] The native version string of the native extension.
Camera
  version : String
[read-only] The version of this extension.
Camera
Public Methods
 MethodDefined By
  
Constructor
Camera
  
authorisationStatus(type:String):String
Retrieves the current authorisation status of this application for the specified AuthorisationType There are several possible values as defined in the AuthorisationStatus class.
Camera
  
Connect to the specified device using the supplied camera parameters.
Camera
  
disconnect():Boolean
Releases any access to the camera the application may hold.
Camera
  
dispose():void
Disposes the extension and releases any allocated resources.
Camera
  
Returns the available capture devices.
Camera
  
Retrieves a list of the available image formats for image stills
Camera
  
Returns the currently connected device, or null if none are connected.
Camera
  
hasAuthorisation(type:String):Boolean
Helper method to determine if the current application has access to the device camera
Camera
  
init(key:String):void
Deprecated: You no longer need to use an application key
[static] Initialises the extension class for use with the provided key.
Camera
  
iOS 8 introduced the ability to send your user to your application's device settings within the iOS Settings.
Camera
  
requestAuthorisation(type:String):Boolean
Performs a simple operation to display the permission dialog.
Camera
Public Constants
 ConstantDefined By
  EXT_CONTEXT_ID : String = com.distriqt.Camera
[static]
Camera
  VERSION : String = 6.2.0
[static]
Camera
Property Detail
canOpenDeviceSettingsproperty
canOpenDeviceSettings:Boolean  [read-only]

Returns true if you can display the device settings for your application.


Implementation
    public function get canOpenDeviceSettings():Boolean
implementationproperty 
implementation:String  [read-only]

The implementation currently in use. This should be one of the following depending on the platform in use and the functionality supported by this extension:


Implementation
    public function get implementation():String
instanceproperty 
instance:Camera  [read-only]

The singleton instance of the Camera class.


Implementation
    public static function get instance():Camera

Throws
Error — If there was a problem creating or accessing the extension, or if the key is invalid
isSupportedproperty 
isSupported:Boolean  [read-only]

Whether the camera is supported on the current device


Implementation
    public static function get isSupported():Boolean
nativeVersionproperty 
nativeVersion:String  [read-only]

The native version string of the native extension.


Implementation
    public function get nativeVersion():String
versionproperty 
version:String  [read-only]

The version of this extension.

This should be of the format, MAJOR.MINOR.BUILD


Implementation
    public function get version():String
Constructor Detail
Camera()Constructor
public function Camera()

Constructor

Method Detail
authorisationStatus()method
public function authorisationStatus(type:String):String

Retrieves the current authorisation status of this application for the specified AuthorisationType There are several possible values as defined in the AuthorisationStatus class.

Parameters

type:String (default = NaN)

Returns
String — The AuthorisationStatus string

See also

connect()method 
public function connect(deviceInfo:CameraDeviceInfo, options:CameraParameters = null):CameraDevice

Connect to the specified device using the supplied camera parameters.

Parameters

deviceInfo:CameraDeviceInfoCameraDeviceInfo of the device to connect
 
options:CameraParameters (default = null) — specific camera parameters. If none are provided or null is used then the default parameters will be used

Returns
CameraDevice — If successfully initialised a CameraDevice reference is returned which can be used to control the camera device. This will return null if a device is already connected or if the device failed to initialise.
disconnect()method 
public function disconnect():Boolean

Releases any access to the camera the application may hold.

This will force and recording or other activities to stop so you should finalise any active operations before calling this function.

This is the same as calling Camera.instance.getCurrentDevice().disconnect() or simply device.disconnect(); on your device reference.

Returns
Boolean
dispose()method 
public function dispose():void

Disposes the extension and releases any allocated resources. Once this function has been called, a call to init is neccesary again before any of the extensions functionality will work.

getAvailableDevices()method 
public function getAvailableDevices():Array

Returns the available capture devices. This will include any camera's on the device (front and back) and potentially any microphone devices.

Please note this function may be costly as it has to query each camera device individually for properties. You should use this function sparingly.

Returns
Array — An Array of CameraDeviceInfo objects

See also

CameraDeviceInfo
getAvailableImageFormats()method 
public function getAvailableImageFormats():Array

Retrieves a list of the available image formats for image stills

Returns
Array — An Array of String's each representing a supported format on the device
getCurrentDevice()method 
public function getCurrentDevice():CameraDevice

Returns the currently connected device, or null if none are connected.

Returns
CameraDevice
hasAuthorisation()method 
public function hasAuthorisation(type:String):Boolean

Helper method to determine if the current application has access to the device camera

Parameters

type:String (default = NaN)

Returns
Boolean
init()method 
public static function init(key:String):void
Deprecated: You no longer need to use an application key

Initialises the extension class for use with the provided key.

Parameters

key:String


Throws
Error — If there was a problem creating or accessing the extension, or if the key is invalid
openDeviceSettings()method 
public function openDeviceSettings():Boolean

iOS 8 introduced the ability to send your user to your application's device settings within the iOS Settings.

Returns
Booleantrue if the settings open was successful and false if the device settings are not available.
requestAuthorisation()method 
public function requestAuthorisation(type:String):Boolean

Performs a simple operation to display the permission dialog.

iOS: Note this will only be shown if the authorisation status is currently NOT_DETERMINED

Parameters

type:String (default = NaN)

Returns
Boolean
Constant Detail
EXT_CONTEXT_IDConstant
public static const EXT_CONTEXT_ID:String = com.distriqt.Camera

VERSIONConstant 
public static const VERSION:String = 6.2.0