new Viewer(options)
A Viewer can be used to stream a single MJPEG topic into a canvas.
Emits the following events:
* 'warning' - emitted if the given topic is unavailable
* 'change' - emitted with the topic name that the canvas was changed to
Parameters:
Name | Type | Description |
---|---|---|
options |
possible keys include: * divID - the ID of the HTML div to place the canvas in * width - the width of the canvas * height - the height of the canvas * host - the hostname of the MJPEG server * port (optional) - the port to connect to * quality (optional) - the quality of the stream (from 1-100) * topic - the topic to stream, like '/wide_stereo/left/image_color' * overlay (optional) - a canvas to overlay after the image is drawn * refreshRate (optional) - a refresh rate in Hz * interval (optional) - an interval time in milliseconds |
- Source:
- visualization/Viewer.js, line 25
Methods
-
changeStream(topic)
-
Change the stream of this canvas to the given topic.
Parameters:
Name Type Description topic
the topic to stream, like '/wide_stereo/left/image_color' - Source:
- visualization/Viewer.js, line 98
-
<inner> draw()
-
A function to draw the image onto the canvas.
- Source:
- visualization/Viewer.js, line 59