Global

Members

(constant) BASE_URL :string

Base URL for all HTTP API requests.

Due to the various environments in which the SDK can be loaded and the different ways that a Capture Bridge instance may be configured. The BASE_URL variable used for all default HTTP API request can be set in several ways:

When running the SDK within a web browser the following locations are checked, in order:

  1. A meta tag containing a url: <meta name="capturebridge:url" content="proto://fqdn:port" />
  2. In the global Window object: window.CAPTURE_BRIDGE_URL
  3. In the origin in which the SDK is running: window.location.origin
  4. The DEFAULT_URL constant from Common.js

When running the SDK within Node.js the following locations are checked, in order:

  1. In a CAPTURE_BRIDGE_URL environment variable
  2. The DEFAULT_URL constant from Common.js

Note that each constructor also accepts a baseUrl parameter that will override any value for BASE_URL previously set.

Source:
Default Value:
Type:
  • string

(constant) DATAURL_GIF :string

data: prefix for GIF Data URLs

Source:
Type:
  • string

(constant) DATAURL_JPEG :string

data: prefix for JPEG Data URLs

Source:
Type:
  • string

(constant) DATAURL_JSON :string

data: prefix for JSON Data URLs

Source:
Type:
  • string

(constant) DATAURL_PNG :string

data: prefix for PNG Data URLs

Source:
Type:
  • string

(constant) DEFAULT_URL :string

Default URL for API requests.

Source:
Type:
  • string

(constant) DELETE :object

Common Fetch options for making DELETE requests to the API.

Source:
Type:
  • object

(constant) LOG_LEVELS :Object.<string, number>

Source:
Type:
  • Object.<string, number>

(constant) POST :object

Description:
  • Common Fetch options for making POST requests to the API.

Source:

Common Fetch options for making POST requests to the API.

Type:
  • object

(constant) VERSION :string

SDK Version as published on NPM

Source:
Type:
  • string

(constant) base64ToDataURL :string

For a given base64 string, convert it to the appropriate Data URL

Source:
Type:
  • string

(constant) stripDataUrl :string

Strip the data URL identifier from a string

Source:
Type:
  • string

Type Definitions

CaptureOptions

Default options for capture operations.

Source:
Properties:
Name Type Attributes Description
rotate number <nullable>

Angle, in degrees to rotate the captured object. Must be a value from -359 to 359. A value of 0 will perform no rotation.

base64 boolean <nullable>

Return the captured object as a base64 encoded string. The default behavior is to return the image as binary data.

kind CaptureResponseKind

Specifies how to return the captured object. Some SDK methods that are designed to only return a particular type, such as Device#frameAsBase64, ignore this parameter. This parameter is also not sent in API requests, it is used internally by the SDK for constructing the appropriate response type.

format CaptureResponseFormat

The image format to be returned.

Type:
  • object

CaptureResponseFormat

The image format to be returned.

Valid values:

  • jpg
  • tiff
  • gif
  • png

If not provided, a plugin or device-specific format will be returned.

Note:

  • Some plugins have configuration options for specifying the return format, such configuration options should be used instead of this parameter to prevent unecessary transcoding.
  • Web browsers are not typically capable of displaying TIFF images.

Source:
Type:
  • string

CaptureResponseKind

Specifies the desired return type for a captured object. Valid values are objecturl, blob, buffer, base64, or dataurl.

  • objecturl will load the captured object into an ObjectURL that can be set directly on an img tag's src attribute. Note that these URLs should be revoked when they are no longer needed.

  • buffer will load the image into an ArrayBuffer

  • blob will return a Blob that can be used with a FileReader.

  • base64 will return the image contents as a Base64 encoded string that is suitable for use with JSON serialization.

  • dataurl will return a Data URL that can be set on an img tag's src attribute or loaded as a document location.

Source:
Type:
  • string

StreamOptions

Default options for stream operations

Source:
Properties:
Name Type Attributes Description
rotate number <nullable>

Angle, in degrees to rotate the stream. Must be a value from -359 to 359. A value outside of that range, or a 0 will perform no rotation.

Type:
  • object