Package | com.distriqt.extension.camera |
Class | public final class Camera |
Inheritance | Camera 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 FeaturesSupported on the following platforms:
Property | Defined 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 |
Method | Defined By | ||
---|---|---|---|
Camera()
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 | ||
getAvailableDevices():Array
Returns the available capture devices. | Camera | ||
getAvailableImageFormats():Array
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 | ||
openDeviceSettings():Boolean
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 |
Constant | Defined By | ||
---|---|---|---|
EXT_CONTEXT_ID : String = com.distriqt.Camera [static] | Camera | ||
VERSION : String = 6.2.0 [static] | Camera |
canOpenDeviceSettings | property |
canOpenDeviceSettings:Boolean
[read-only]
Returns true if you can display the device settings for your application.
public function get canOpenDeviceSettings():Boolean
implementation | property |
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:
Android
iOS
default
unknown
public function get implementation():String
instance | property |
instance:Camera
[read-only] The singleton instance of the Camera class.
public static function get instance():Camera
Error — If there was a problem creating or accessing the extension, or if the key is invalid
|
isSupported | property |
isSupported:Boolean
[read-only] Whether the camera is supported on the current device
public static function get isSupported():Boolean
nativeVersion | property |
nativeVersion:String
[read-only]
The native version string of the native extension.
public function get nativeVersion():String
version | property |
version:String
[read-only]
The version of this extension.
This should be of the format, MAJOR.MINOR.BUILD
public function get version():String
Camera | () | Constructor |
public function Camera()
Constructor
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 )
|
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:CameraDeviceInfo — CameraDeviceInfo 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
|
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.
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.
ReturnsArray — An Array of CameraDeviceInfo objects
|
See also
getAvailableImageFormats | () | method |
public function getAvailableImageFormats():Array
Retrieves a list of the available image formats for image stills
ReturnsArray — 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.
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 )
|
Boolean |
init | () | method |
public static function init(key:String):void
Initialises the extension class for use with the provided key.
Parameters
key:String |
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.
ReturnsBoolean — true 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 )
|
Boolean |
EXT_CONTEXT_ID | Constant |
public static const EXT_CONTEXT_ID:String = com.distriqt.Camera
VERSION | Constant |
public static const VERSION:String = 6.2.0