SDK Reference
Initialization
Instantiate the Visionable Client, passing your configuration settings
const client = new VisiWebRTC(settings);The settings parameter is an object with the following properties:
Key | Type | Description |
|---|---|---|
String | The user's email address (optional) | |
password | String | The user's password (optional) |
meeting_id | String | You can authenticate by meeting ID to join the meeting as a guest (optional) |
session_id | String | You can use an existing |
server | String | The hostname of the Visionable UCS |
name | String | The display name you'd like to use |
callback | Called when we've finished initializing and connecting to the server |
AuthenticationYou must authenticate using either a username & password, a meeting-id, or a session-id.
Methods
connectToMeeting
client.connectToMeeting(settings)The settings parameter is an object with the following properties:
Key | Type | Description |
|---|---|---|
meeting_id | String | The meeting UUID |
videoStreamAdded | Called when a video stream has been added to the meeting | |
videoStreamRemoved | Called when a video stream has been removed from the meeting. | |
toolsNotification | Called when a tools event has occurred. | |
callback | Called when the meeting join has completed. |
enableLocalVideo
client.enableLocalVideo([parent], [callback], [maxBandwidth], [resolution], [deviceId])Parameter | Type | Description |
|---|---|---|
parent | String | DOM selector in which the video should be rendered, defaulting to the document body |
callback | Function | Called after the stream is enabled |
maxBandwidth | Number | Used to limit the send bandwidth for this video stream |
resolution | String | Can be one of "320x180", "320x240", "640x480", "640x360", "960x720", or "1280x720" |
deviceId | String | Can be one of the device IDs from |
disableLocalVideo
client.disableLocalVideo([deviceId])Parameter | Type | Description |
|---|---|---|
deviceId | String | The ID of the device you want to disable |
enableRemoteVideo
client.enableRemoteVideo(streamId, parent, callback)Parameter | Type | Description |
|---|---|---|
streamId | String | The ID of the remote stream you want to enable |
parent | String | DOM selector in which the video should be rendered, defaulting to the document body |
callback | Function | Called after the stream is enabled |
disableRemoteVideo
client.disableRemoteVideo(streamId)Parameter | Type | Description |
|---|---|---|
streamId | String | The ID of the remote stream you want to disable |
enableAudio
Enables the input microphone for the device.
client.enableAudio()audioOutputVolume
client.audioOutputVolume(volume)Parameter | Type | Description |
|---|---|---|
volume | Number | A number between 0 and 1 |
muteAudioInput
Mute your microphone
client.muteAudioInput()unMuteAudioInput
Unmute your microphone
client.unMuteAudioInput()muteAudioOutput
Mute your speakers
client.muteAudioOutput()unMuteAudioOutput
Unmute your speakers
client.unMuteAudioOutput()disconnect
Disconnect from the meeting
client.disconnect()tools.Chat
client.tools.Chat(user, message);Parameter | Type | Description |
|---|---|---|
user | String | The username you'd like to chat to. Set to * to send to the entire meeting |
message | String | The chat message |
tools.ShareUrl
client.tools.ShareUrl(url)Parameter | Type | Description |
|---|---|---|
url | String | URL to share into the meeting |
Interfaces
InitializationCallback
function (error)Parameter | Type | Description |
|---|---|---|
error | String | Null | Error description, or |
VideoAddedCallback
function (streamId, email, name, camName)Parameter | Type | Description |
|---|---|---|
streamId | String | The video stream ID |
String | The user's email address | |
name | String | The user's display name |
camName | String | The camera identifier |
VideoRemovedCallback
function (streamId)Parameter | Type | Description |
|---|---|---|
streamId | String | The video stream ID |
ToolsCallback
function (xml)Parameter | Type | Description |
|---|---|---|
xml | String | The Tools event XML. See Tools Events below |
ConnectMeetingCallback
function (error, videoStreamMax, meetingId, subject)Parameter | Type | Description |
|---|---|---|
error | String | Null | Error description, or |
videoStreamMax | Number | The maximum number of video streams you're allowed to send |
meetingId | String | The meeting ID of the meeting you've joined |
subject | String | The meeting subject |
Tools Events
chat_user_added
<?xml version="1.0" encoding="UTF-8"?>
<notify>
<event name="chat_user_added">
<user id="[email protected]">
<handle>Example User</handle>
<status>Online</status>
</user>
</event>
</notify>chat_user_removed
<?xml version="1.0" encoding="UTF-8"?>
<notify>
<event name="chat_user_removed">
<user id="[email protected]"/>
</event>
</notify>chat_chat
<?xml version="1.0" encoding="UTF-8"?>
<notify>
<event name="chat_chat">
<from>[email protected]</from>
<to>*</to>
<chat>Hello there!</chat>
</event>
</notify>file_added
<?xml version="1.0" encoding="UTF-8"?>
<notify>
<event name="file_added">
<user id="[email protected]">
<file id="house.jpeg">
<location>http://example.com:554/igpix/c6058646-4d2b-407d-8234-c1347f009ae9/[email protected]/igfiles/house.jpeg</location>
<size>194</size>
</file>
</user>
</event>
</notify>file_removed
<?xml version="1.0" encoding="UTF-8"?>
<notify>
<event name="file_removed">
<user id="[email protected]">
<file id="house.jpeg"/>
</user>
</event>
</notify>url_shared
<?xml version="1.0" encoding="UTF-8"?>
<notify>
<event name="url_shared">
<user id="[email protected]">
<url>https://example.com/igpix/e8dc74fa-462c-4fb1-ae36-1678d2196356/[email protected]/igweb.jpg?id=756919</url>
</user>
</event>
</notify>Updated 3 months ago
