CameraDevice
Defined in: system/camera.ts:30
The CameraDevice Class is the object returned by #system/System System Class getCameraDevices method. It provides you with methods to fetch the Camera Device’s id, name, and to add it as a source in the current scene.
Basic Usage
Section titled “Basic Usage”var XJS = require('xjs');var System = XJS.System;
System.getCameraDevices().then(function(cameras) { for (var i in cameras) { xml = cameras[i].toXML(); // do something with the XML here }});Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new CameraDevice(
props?):CameraDevice
Defined in: system/camera.ts:34
Parameters
Section titled “Parameters”props?
Section titled “props?”Returns
Section titled “Returns”CameraDevice
Methods
Section titled “Methods”addToScene()
Section titled “addToScene()”addToScene(
value?):Promise<any>
Defined in: system/camera.ts:125
param: (value?: number | Scene)
return: Promise<any>Adds this camera device to the current scene by default. Accepts an optional parameter value, which, when supplied, points to the scene where item will be added instead. If ready config {listenToItemAdd: true} it returns item id, else returns boolean.
Note: There is yet no way to detect error responses for this action.
Parameters
Section titled “Parameters”value?
Section titled “value?”number | Scene
Returns
Section titled “Returns”Promise<any>
Implementation of
Section titled “Implementation of”getId()
Section titled “getId()”getId():
string
Defined in: system/camera.ts:51
return: string
Get the ID of the device. The ID of the device is based on the disp
attribute of the devices XML
var cameraID = device.getId();Returns
Section titled “Returns”string
getName()
Section titled “getName()”getName():
string
Defined in: system/camera.ts:66
return: string
Get the Name of the device.
var cameraName = device.getName();Returns
Section titled “Returns”string
toXML()
Section titled “toXML()”toXML():
XML
Defined in: system/camera.ts:81
return: XML
Convert the current CameraDevice object to XML
var xml = device.toXML();Returns
Section titled “Returns”parse()
Section titled “parse()”
staticparse(deviceJSON):CameraDevice
Defined in: system/camera.ts:102
param: (deviceJSON: JXON)
return: CameraDeviceCreate a CameraDevice object based on a JXON object
var camera = CameraDevice.parse(JSONObj);Parameters
Section titled “Parameters”deviceJSON
Section titled “deviceJSON”Returns
Section titled “Returns”CameraDevice