GraffitiCamera

View Categories

Enumerations #

Name Values
FacingModes User
Environment

Constants #

Name Type Value
This class exposes no constants.

Events #

Definition Parameters Return Type Description
DevicesLoaded None None Raised when the browser has sent the list of supported devices.
FrameReceived frameData as String None BASE64 encoded image data received from camera.
frame as Picture
StreamError errorMessage as String None Raised when an error has occurred while streaming the media. This is usually a fatal error meaning that support is lacking in the browser or there’s a problem with the device.

Methods #

Name Parameters Return Type Description
DeviceExists deviceId as String Boolean Returns True if the supplied device ID exists.
IsMobile None Boolean Returns True if the current browser is running on an Android or iOS device.
Pause None None Pause real-time display.
Play frameSize as Size = Nil None Play real-time display.
RequestFrame None None Get a single frame from the real-time display.
Stop None None Stop real-time display.

Properties #

Name Type Default Value Description
Devices GraffitiWebCameraDevice None All supported devices.
FacingMode FacingModes FacingModes.User Camera used for mobile devices that only supply one camera device ID but differentiate between User and Environment facings.
isPaused Boolean False True when real-time display is paused.
isPlaying Boolean False True when real-time display is playing.
Supported Boolean False True if the user’s browser supports the API.

Notes #

Security #

Most modern browsers, for security reasons, will not allow access to the computer’s camera unless the page is loaded over a secure (HTTPS) connection. This means you must deploy with a valid certificate or text locally over HTTPS with a self-signed certificate.