The Camera Class

     

The Camera Class

Table A.17. Camera Methods

Name

Format

Description

get

Camera.get([ index ])

Returns the video stream from the default camera or the camera specified by index . Returns null if no camera is available. (If more than one camera is installed, the user specifies the default camera in the Flash Player Camera Settings panel.)

setMode

myCamera.setMode( width , height , fps [, favorSize ])

Sets attributes of the camera capture mode, including height, width, and frames per second. favorSize is an optional Boolean value. To maximize frame rate at the expense of height and width, set favorSize to false . To favor maintaining height and width over frame rate, set favorSize to true .

SetMotionLevel

myCamera.setMotionLevel (sensitivity [,timeout ])

sensitivity is an integer from 0 to 100 that specifies how much motion is required to invoke Camera.onActivity(true) . The default is 50. timeout specifies how many milliseconds must elapse without motion before Camera.onActivity(false) is invoked. The default is 2000 (2 seconds).


Table A.18. Camera Attributes

Format

Description

myCamera.activityLevel

The amount of motion the camera is detecting, from (none) to 100 (maximum). Prior to a myVideoObject.attachVideo() call, this is -1 . Read-only.

myCamera.bandwidth

The maximum amount of bandwidth the current outgoing video feed can use, in bytes. Read-only.

myCamera.currentFps

The rate at which the camera is capturing data, in frames per second. Read-only.

myCamera.fps

The rate at which you would like the camera to capture data, in frames per second. Read-only.

myCamera.height

The current capture height, in pixels. Read-only.

myCamera.index

The index of the camera, as reflected in the array returned by Camera. names . Read-only.

myCamera.motionLevel

The amount of motion required to invoke Camera.onActivity(true) . Read-only.

myCamera.motionTimeOut

The number of milliseconds between the time the camera stops detecting motion and the time Camera.onActivity(false) is invoked. Read-only.

myCamera.muted

A read-only Boolean value that specifies whether the user has allowed or denied access to the camera.

myCamera.name

The name of the camera as specified by the camera hardware. Read-only.

Camera.names

A class property, an array of strings containing the names of all available video capture devices, including video cards and cameras . Read-only.

myCamera.quality

A number from 1 to 100 that specifies the current level of picture quality. More compression means lower quality: 1 is lowest quality, maximum compression. 100 is highest quality, no compression. Read-only.

myCamera.width

The current capture width, in pixels. Read-only.


Table A.19. Camera Event Handlers

Name

Format

Description

onActivity

myCamera.onActivity = function( activity ) {}

Invoked when the camera starts or stops detecting motion. activity is a Boolean value set to true when the camera starts detecting motion, false when it stops.

onStatus

myCamera.onStatus = function( infoObject ){}

Invoked when the user allows or denies access to the camera.




Using Macromedia Studio MX 2004
Special Edition Using Macromedia Studio MX 2004
ISBN: 0789730421
EAN: 2147483647
Year: N/A
Pages: 339

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net