Whiteboard
Extends:
Provides access to methods for creating whiteboards. This class must not be directly instantiated. It can be obtained using session#createWhiteboard or listening to session#incommingWhiteBoard event.
Events
shape
is emitted every time a new shape is added.clear
is emitted every time the other end clears every shape from the whiteboard.closed
is emitted when the whiteboard session has finished.
You can check EventEmitter2 documentation for additional information about adding and removing listeners for this events events.
Example:
session.createWhiteboard(participants).then(function(whiteboard));
whiteboard.setArea('body');
whiteboard.tool = 'add-line';
whiteboard.on('closed', function() {
board.setArea(null);
});
...
board.close();
});
session.on('incomingWhiteBoard', function(board) {
board.setArea('body');
board.on('closed', function() {
board.setArea(null);
});
});
Static Member Summary
Static Public Members | ||
public static get |
Gets the version of the protocol implemented. |
|
public static get |
Gets the valid values for the tool field. |
Member Summary
Public Members | ||
public get |
Returns the current aspect ratio of the whiteboard |
|
public set |
Updates the aspect ratio of the whiteboard |
|
public get |
Gets the current background image shown. |
|
public set |
Sets the current background image shown. |
|
public get |
Gets the current background video shown. |
|
public set |
Sets the current background video shown. |
|
public get |
Gets the color used for the shapes. |
|
public set |
Sets the color used for the shapes. |
|
public get |
Returns the current height of the whiteboard |
|
public get |
lineWidth: * |
|
public set |
|
|
public get |
Gets the identities of the remote peers attached to this Whiteboard. |
|
public get |
Gets the current tool to use on user interaction. |
|
public set |
Sets the current tool to use on user interaction. |
|
public get |
Returns the current width of the whiteboard |
Method Summary
Public Methods | ||
public |
Check if last undo call can be reverted. |
|
public |
Check if last action can be reverted. |
|
public |
Removes every shape from the whiteboard |
|
public |
close(): Whiteboard Closes this whiteboard session. |
|
public |
init(): Promise<Whiteboard> Initializes the Whiteboard Sets the datapipe object that will be used for receiving and transmiting data. |
|
public |
redo() Revert last undo call. |
|
public |
setArea(selector: string | HTMLElement | null): Whiteboard Allows to set the area that will be used as the canvas for the whiteboard. |
|
public |
undo() Revert last change. |
Static Public Members
Public Members
public set backgroundVideo: string source
Sets the current background video shown. Valid values are "local", "remote" and ""
public get lineWidth: * source
public set lineWidth source
Public Methods
public init(): Promise<Whiteboard> source
Initializes the Whiteboard Sets the datapipe object that will be used for receiving and transmiting data.
public setArea(selector: string | HTMLElement | null): Whiteboard source
Allows to set the area that will be used as the canvas for the whiteboard.