Constructor
new Plugin(plugin, baseURLopt)
- Description:
Instantiate a plugin.
- Source:
- See:
-
CaptureBridge#plugins
Get all installed plugin.CaptureBridge#plugin
Get a single plugin by ID.
Parameters:
Name | Type | Attributes | Default | Description | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
plugin |
object | string | plugin object as received from the API or a plugin ID string. Properties
|
|||||||||||||||||||||||
baseURL |
string |
<optional> |
BASE_URL
|
Override the default protocol, domain, and port for the service. |
Throws:
Will throw an Error the plugin argument is not a plugin ID (String) or an object.
Members
baseUrl
Properties:
Name | Type | Description |
---|---|---|
id |
string | ID of the plugin, used when building REST endpoint paths. |
name |
string | Human friendly name for the plugin. |
description |
string | Human friendly description of plugin. |
version |
string | Semantic version version of the plugin. |
methods |
Array.<string> | A plugin's list of supported RPC methods. |
ready |
boolean | True if plugin has been loaded into memory and is ready to receive requests. |
defaultDevice |
object | Default device to use for the plugin. |
configMethods |
Array.<string> | Methods required to implement configuration. |
Methods
(async) device(id) → (nullable) {object}
- Description:
Get a device by ID for this plugin
- Source:
- See:
Example
const plugin = await captureBridge.plugin('capture_camera_canon')
const device = await plugin.device('AWOOO56709')
Parameters:
Name | Type | Description |
---|---|---|
id |
string | Device ID |
Returns:
Requested Device
or null
- Type
- object
(async) devices() → {Array.<object>}
- Description:
Get all devices for this plugin
- Source:
- See:
Example
const plugin = await captureBridge.plugin('capture_camera_canon')
const devices = await plugin.devices()
Returns:
Array of Device
objects.
- Type
- Array.<object>
(async) hasMethod(method) → {boolean}
Example
const canCapture = await plugin.hasMethod('capture')
Parameters:
Name | Type | Description |
---|---|---|
method |
string | An RPC method |
Returns:
Return true if plugin has the provided method.
- Type
- boolean
(async) shutdown(timeoutopt)
- Description:
Shutdown a plugin
- Source:
- See:
Example
await plugin.shutdown()
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
timeout |
number |
<optional> |
10
|
Timeout in seconds. Forcefully terminate
the plugin if it doesn't shutdown cleanly within the specified timeout. A
value of |