Options
All
  • Public
  • Public/Protected
  • All
Menu

broox.js API Reference

Broox library

This is JavaScript API Reference for broox.js library.

Media Player

Provides context to the apps executed within the Media Player.

Usage


import { BlobsController, getMediaInfo } from './brooxMediaPlayer.js';

BlobsController

Parses tuio events recieved by apps and keeps track of the blobs.

 // example
const blobsController = new BlobsController(width, height, false, () => {...);
const skeletons = blobsController.getSkeletons();

KeyValue

Allows apps to persist json values associated to a project and a key.

// example
const user = {
firstName: 'John',
lastName: 'Doe'
};
const keyValue = new KeyValue();
keyValue.set('testApp', 'profile', user);
const profile = keyValue.get('testApp', 'profile');

GestureHandler

Parses OSC events recieved by apps and allows to handle the different gestures.

// example
const gestureHandler = new GestureHandler(500, 2);
gestureHandler.onPresence(() => console.log('Presence'));

OscListener

Listens to OSC events and executes callback functions.

// example
const oscListener = new OscListener();
oscListener.add('/start', () => console.log('Start'));

Functions

Media

Provides classes and functions related to the rendering process of different media.

Usage


import { Composition, startDevice } from './brooxMedia.js';

Composition

Allows to create an image based on many media objects (images, videos, etc.).

// example
const composition = new Composition(width, height, borderWidth);
composition.addElement(webcam, 0, 0, webcam.videoWidth, webcam.videoHeight, 1, false);
composition.get().then(blob => {
image.src = URL.createObjectURL(blob);
)};

// example
const recorder = new Recorder(stream);
recorder.start();
setTimeout(() => {
recorder.stop().then(blob => {
console.log(blob);
)};
}, 10000);

Functions

Logger

Provides logging options.

Usage


import { LogController } from './brooxLogger.js';

LogController

Enables or disables logs to console.

 // example
const logController = new LogController(true, () => {...);
console.log(message);

Vision Node

Provides context to communicate with Vision Node.

Usage

import { SkeletonController } from './brooxVisionNode.js';

SkeletonController

Parses MQTT events sent by Vision Node and keeps track of the skeletons.

// example
const skeletonController = new SkeletonController(width, height, () => {...);
const skeletons = blobsController.getSkeletons();

GestureHandler

Parses MQTT events sent by Vision Node and allows to handle the different gestures.

// example
const gestureHandler = new GestureHandler(500, 2);
gestureHandler.onPresence(() => console.log('Presence'));

KeyValue

Allows apps to persist json values associated to a project and a key.

// example
const user = {
firstName: 'John',
lastName: 'Doe'
};
const keyValue = new KeyValue();
keyValue.set('testApp', 'profile', user);
const profile = keyValue.get('testApp', 'profile');

MqttClient

MQTT client.

// example
const client = new MqttClient('localhost', 1884);
client.onMessage(() => console.log(message));

Controller

Provides context to communicate with Controller.

Usage


import { getNodes } from './brooxController.js';

Functions


Generated using TypeDoc