Whiteboard API

The Agora Whiteboard SDK library includes the following class:

Agora.Whiteboard: Use the Agora.Whiteboard object to join and leave shared sessions.

join(params)

This method allows user to join a shared session. It will create a session if the user initiates that call.

Parameter Type Description
params Object The only parameter for the join method, which includes the following settings.
key String Key can be one of the following:
 
  • App ID: provided by Agora during registration.
  • Channel Key: the token generated with App ID and App Certificate.
A NodeJS implementation of token-gen algorithm is provided. This is the safest and recommended way to access the Agora Global Network.
cname String The string that provides the unique channel name for the Agora.Whiteboard session.
host String The role of the user:
1: host
0: attendee
Host can take control of the whiteboard, attendee is view only.
expire Number If the expiration date not specified, the validity period is 24 hours starting from the moment the channel is created.
container String The identity of the DOM node.
width String The container width.
height String The container height
uinfo String (optional) user name

sample code:

  var hostParams = {
            key        : 'f4637604af81440596a54254d53ade29',
            cname    : 'PES-2017',
            host       : 1,
            width      : 800,
            height     : 600,
            container  : "wbHost"
};
 /* Call AgoraWhiteBoardApi */
Agora.Whiteboard.join(hostParams);

leave(url)

This method allows users to leave a shared session.

Parameter Name Type Description
url String (optional) Specify the url that the user will be redirected to.

Sample code:

Agora.Whiteboard.leave("http://sample.com");