Class: Webcam

Webcam(constraints, videoElementSelector)

Class to setup the webcam.

Constructor

new Webcam(constraints, videoElementSelector)

Create a Webcam.
Parameters:
Name Type Description
constraints Object options to use for initialising the camera. This is the same constraints object as used by standard MediaDevices API.
videoElementSelector string selector to obtain the HTML video element to render the webcam feed. If a falsy value (e.g. null or undefined), a video element will be created.
Source:

Methods

dispose()

Free up the memory associated with the webcam. Should be called when your application closes.
Source:

Events

webcamerror

Webcam error event.
Parameters:
Name Type Description
event Object object with 'code' and 'message' fields.
Source:

webcamstarted

Webcam started event.
Parameters:
Name Type Description
event Object object containing 'texture' - the texture the webcam will stream to.
Source: