Skip to content

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.

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
}
});

new CameraDevice(props?): CameraDevice

Defined in: system/camera.ts:34

CameraDevice

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.

number | Scene

Promise<any>

Addable.addToScene


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();

string


getName(): string

Defined in: system/camera.ts:66

return: string

Get the Name of the device.

var cameraName = device.getName();

string


toXML(): XML

Defined in: system/camera.ts:81

return: XML

Convert the current CameraDevice object to XML

var xml = device.toXML();

XML


static parse(deviceJSON): CameraDevice

Defined in: system/camera.ts:102

param: (deviceJSON: JXON)

return: CameraDevice

Create a CameraDevice object based on a JXON object

var camera = CameraDevice.parse(JSONObj);

JSON

CameraDevice