Documentation

Documentation for the two classes GuestVC and AdminVC with method descriptions

Class GuestVC

Class for creating a connection from the guest side

connect

Desc: Join to room

Type

Param

Return

method

-

-

disconnect

Desc: Leave the room

circle-info

It can be called anywhere in the code, but after defining an instance of this class

Type

Param

Return

method

-

-

setVideoContainerForTestCamera

Desc: Set video container for testing to display camera

circle-info

Use before testing starts

Type

Param

Return

method

elem HTML

-

setCameraDevice

Desc: Set camera device

circle-info

Use before connecting to the session

Type

Param

Return

method

string - device ID

-

setMicroDevice

Desc: Set micro device

Type

Param

Return

method

string - device ID

-

circle-info

Use before connecting to the session

setSoundDevice

Desc: Set sound device

circle-info

Use before connecting to the session

Type

Param

Return

method

string - device ID

-

getMicroDevicesList

Desc: Get micro devices list

circle-info

Use before connecting to the session

Type

Param

Return

method

-

objects array

{

deviceId: "",

label: ""

}

getCameraDevicesList

Desc: Get camera devices list

circle-info

Use before connecting to the session

Type

Param

Return

method

-

objects array

{

deviceId: "",

label: ""

}

getSoundDevicesList

Desc: Get sound devices list

circle-info

Use before connecting to the session

Type

Param

Return

method

-

objects array

{

deviceId: "",

label: ""

}

getCurrentCameraDevice

Desc: get current camera device ID

circle-info

Use before connecting to the session

Type

Param

Return

method

-

string

getCurrentSoundDevice

Desc: get current sound device ID

circle-info

Use before connecting to the session

Type

Param

Return

method

-

string

getCurrentMicroDevice

Desc: get current micro device ID

circle-info

Use before connecting to the session

Type

Param

Return

method

-

string

startTest

Desc: Start testing devices

circle-info

Use before connecting to the session

Type

Param

Return

method

-

-

stopTest

Desc: Stop testing devices

circle-info

Use before connecting to the session

Type

Param

Return

method

-

-

setElementHTMLMessages

Desc: Set elem HTML for display chat

circle-info

It can be called anywhere in the code, but after defining an instance of this class

Type

Param

Return

method

elem HTML

-

sendMsg

Desc: Send message for chat

Type

Param

Return

method

string - message for send

-

string - user ID for direct message (example, @student1234 Hello!)

setClassStyleMsg

Desc: Set classes for styling messages for chat

Type

Param

Return

method

{

own: "className",

fromGuestToMe: "className",

fromOwnerToMe: "className",

fromMeToGuest: "className",

guests: "className",

roomOwner: "className"

}

-

own - for display own messages

fromGuestToMe - messages from guest to guest as direct message (other guests doesn't see this message)

fromOwnerToMe - message from room owner to guest as direct message (other guests doesn't see this message)

fromMeToGuest - message as direct message from me to guest

guests - message for all users in room from guests

roomOwner - message from room owner for all users in room

setChatMode

Desc: Set chat config for guests

Type

Param

Return

method

{

isDirect: true/false,

isVisibleForAll: true/false

}

isDirect - can the guest use the direct messaging feature

  • true - can

  • false - can't

isVisibleForAll - can a guest see other guests messages for all

  • true - can

  • false - can't

circle-info

Be sure to set values for all parameters when using this method, or you can choose not to use this method, then the default parameters will be used

microOff

Desc: Disable micro

circle-info

It can be called anywhere in the code, but after defining an instance of this class

Type

Param

Return

method

-

-

microOn

Desc: Enable micro

circle-info

It can be called anywhere in the code, but after defining an instance of this class

Type

Param

Return

method

-

-

localCameraOff

Desc: Disable local camera

circle-info

It can be called anywhere in the code, but after defining an instance of this class

Type

Param

Return

method

-

-

localCameraOn

Desc: Enable local camera

circle-info

It can be called anywhere in the code, but after defining an instance of this class

Type

Param

Return

method

-

-

setUserName

Desc: Set user name

Type

Param

Return

method

string

-

int

setUserID

Desc: Set user ID

Type

Param

Return

method

string

-

getUserID

Desc: Get user ID

Type

Param

Return

method

-

string

getUsersList

Desc: Get users ID in room

Type

Param

Return

method

-

string array

setRoomID

Desc: Set room ID for connection

Type

Param

Return

method

string

-

int

setUserSatusConnection

Desc: Set user connection status

Type

Param

Return

method

bool

-

getUserStatusConnection

Desc: Get current user connection status

Type

Param

Return

method

-

bool

true - connected

false - disconnected

setElementHTMLVideoContainerRemote

Desc: Set HTML elems for display remote video streams

circle-info

Must call before connect

Type

Param

Return

method

HTML elem for display remote screen

-

HTML elem for display remote camera

setElementHTMLVideoContainerLocal

Desc: Set HTML elem for display local camera

circle-info

Must call before connect

Type

Param

Return

method

HTML elem for display local camera

-

setConnectBtnUI

Desc: Set callbacks for changing button state

circle-info

Must call before connect

Type

Param

Return

method

callback for displaying the connection

-

callback for displaying the disconnection

getInstance

Desc: Get instance of class GuestVC

Type

Param

Return

method

-

GuestVC

detect2g

Desc: Detect 2G network and alert the user

Type

Param

Return

method

-

-

sendDataToContentView

Desc: Send some data to room owner for display it in content view

Type

Param

Return

method

structure

-

{

head: "title of custom event"

content: "hello world!"

}

-

setGuestAudibility

Desc: Set whether a guest to hear the other guests in room

Type

Param

Return

method

bool

-

true- guest will be hear other guests

false - guest will not hear other guests

getGuestAudibility

Desc: Set whether a guest to hear the other guests in room

Type

Param

Return

method

-

bool

true - guest will be hear other guests

false - guest will not hear other guests

setLocalVideoConstraints

Desc: Sey local video constraints

Type

Param

Return

method

-

int - width

int - height

int - frame rate

onUserStatusChanged

Desc: Event that is triggered when the status of the room owner changes

circle-info

Be sure to add at the end of the code

Type

Param

Return

method

-

-

onRoomFull

Desc: Event handler that is called when connecting if the room is full

circle-info

Be sure to add at the end of the code

Type

Param

Return

event

-

-

onStream

Desc: Event handler that handle stream

circle-info

Be sure to add at the end of the code

Type

Param

Return

event

-

-

onMediaError

Desc: Event handler that handle stream error

circle-info

Be sure to add at the end of the code

Type

Param

Return

event

-

-

onMessage

Desc: Event handler for messgae from other peers

Type

Param

Return

event

callback

-

Class AdminVC

Class for creating a link on the owner's side

setVideoContainerForTestCamera

Desc: Set video container for testing to display camera

circle-info

Use before testing starts

Type

Param

Return

method

elem HTML

-

setCameraDevice

Desc: Set camera device

circle-info

Use before connecting to the session

Type

Param

Return

method

string - device ID

-

setMicroDevice

Desc: Set micro device

Type

Param

Return

method

string - device ID

-

circle-info

Use before connecting to the session

setSoundDevice

Desc: Set sound device

circle-info

Use before connecting to the session

Type

Param

Return

method

string - device ID

-

getMicroDevicesList

Desc: Get micro devices list

circle-info

Use before connecting to the session

Type

Param

Return

method

-

string array

getCameraDevicesList

Desc: Get camera devices list

circle-info

Use before connecting to the session

Type

Param

Return

method

-

string array

getSoundDevicesList

Desc: Get sound devices list

circle-info

Use before connecting to the session

Type

Param

Return

method

-

string array

getCurrentCameraDevice

Desc: get current camera device ID

circle-info

Use before connecting to the session

Type

Param

Return

method

-

string

getCurrentSoundDevice

Desc: get current sound device ID

circle-info

Use before connecting to the session

Type

Param

Return

method

-

string

getCurrentMicroDevice

Desc: get current micro device ID

circle-info

Use before connecting to the session

Type

Param

Return

method

-

string

startTest

Desc: Start testing devices

circle-info

Use before connecting to the session

Type

Param

Return

method

-

-

stopTest

Desc: Stop testing devices

circle-info

Use before connecting to the session

Type

Param

Return

method

-

-

setMaxGuestCount

Desc: Set max guest count in room

Type

Param

Return

method

int

-

setElementsHTMLVideoContainerRemote

Desc: Set HTML elems for display remote video streams

circle-info

Must call before connect

Type

Param

Return

method

HTML elems for display remote camera (the number of elements must be exactly max guest count)

-

setElementsHTMLVideoContainerLocal

Desc: Set HTML elems for display local camera and screen

circle-info

Must call before connect

Type

Param

Return

method

HTML elem for display local camera

-

HTML elem for display screen

setContentViewContainer

Desc: Set HTML elems for copy children

circle-info

Must call before connect

Type

Param

Return

method

HTML elem

-

setElementHTMLMessages

Desc: Set elem HTML for display chat

circle-info

Must call before connect

Type

Param

Return

method

elem HTML

-

sendMsg

Desc: Send message for chat

Type

Param

Return

method

string - message for send

-

string - user ID for direct message (example, @student1234 Привет!)

setClassStyleMsg

Desc: Set classes for styling messages for chat

Type

Param

Return

метод

{

own: "className",

fromGuestToMe: "className",

fromMeToGuest: "className",

fromGuestToGuest: "className",

guests: "className",

}

-

own - for display own message

fromGuestToMe - message form guest to me as direct message

fromMeToGuest - message from me to guest as direct message

fromGuestToGuest - message from guest to guest as direct message

guests - message from guest for all

setChatMode

Desc: Set chat config for room owner

Type

Param

Return

method

{

isDirect: true/false,

isVisibleGuestForOwner: true/false

}

isDirect - can the owner of the room use the direct message feature

  • true - can

  • false - can't

isVisibleGuestForOwner - can room owner see message from guest to guest as direct message

  • true - can

  • false - can't

circle-info

Be sure to set values for all parameters when using this method, or you can choose not to use this method, then the default parameters will be used

setConnectBtnUI

Desc: Set callbacks for changing button state

circle-info

Must call before connect

Type

Param

Return

method

сallback for displaying the connection

-

сallback for displaying the disconnection

setVideoRecordingConfig

Desc: Set config for screen recorder

Type

Param

Return

method

{

type: "video",

mimeType: "video/webm",

resolution: {

width: 1280,

height: 720

},

frameRate: 30,

bitrate: 128000,

}

-

setUserSatusConnection

Desc: Set user connection status

Type

Param

Return

method

bool

-

true - connected

false - disconnected

getUserStatusConnection

Desc: Get current user connection status

Type

Param

Return

method

-

bool

true - connected

false- disconnected

setRoomID

Desc: Set room ID for connection

Type

Param

Return

method

string

-

int

getUserID

Desc: Get user ID

Type

Param

Return

method

-

string

setUserID

Desc: Set user ID

Type

Param

Return

method

string

-

getUsersList

Desc: Get users ID in room

Type

Param

Return

method

-

string array

setUserName

Desc: Set user name

Type

Param

Return

method

string

-

int

screenRecordingOn

Desc: turn on screen recorder

circle-info

It can be called anywhere in the code, but after defining an instance of this class

Type

Param

Return

method

-

bool

true - if success start

false - if error

screenRecordingOff

Desc: turn on screen recorder

circle-info

It can be called anywhere in the code, but after defining an instance of this class

Type

Param

Return

method

callback(blob)

bool

true - if success end

false - if error

microOff

Desc: Disable micro

circle-info

It can be called anywhere in the code, but after defining an instance of this class

Type

Param

Return

method

-

-

microOn

Desc: Enable micro

circle-info

It can be called anywhere in the code, but after defining an instance of this class

Type

Param

Return

method

-

-

screenShareOn

Desc: Enable screen sharing

circle-info

It can be called anywhere in the code, but after defining an instance of this class

Type

Param

Return

method

-

-

screenShareOff

Desc: Disable screen sharing

circle-info

It can be called anywhere in the code, but after defining an instance of this class

Type

Param

Return

method

-

-

localCameraOff

Desc: Disable local camera

circle-info

It can be called anywhere in the code, but after defining an instance of this class

Type

Param

Return

method

-

-

localCameraOn

Desc: Enable local camera

circle-info

It can be called anywhere in the code, but after defining an instance of this class

Type

Param

Return

method

-

-

detect2g

Desc: Detect 2G network and alert the user

Type

Param

Return

method

-

-

sendDataToContentView

Desc: Send some data to guests for display it in content view

Type

Param

Return

method

structure

-

{

head: "title of custom event"

content: "hello world!"

}

-

disconnect

Desc: Disabling and deleting a room

circle-info

It can be called anywhere in the code, but after defining an instance of this class

Type

Param

Return

method

-

-

connect

Desc: Create room

Type

Param

Return

method

-

-

getInstance

Desc: Get instance of class AdminVC

Type

Param

Return

method

-

AdminVC

changeVideoConstraints

Desc: change guest video constraints from room owner

Type

Param

Return

method

-

int - width

int - height

int - frame rate

onUserStatusChanged

Desc: Event handler that is triggered when the status of the room owner changes

circle-info

Be sure to add at the end of the code

Type

Param

Return

event

-

-

onStream

Desc: Event handler that handle stream

circle-info

Be sure to add at the end of the code

Type

Param

Return

event

-

-

onMediaError

Desc: Event handler that handle stream error

circle-info

Be sure to add at the end of the code

Type

Param

Return

event

-

-

onMessage

Desc: Event handler for massage from guests

circle-info

Be sure to add at the end of the code

Type

Param

Return

event

callback

-

Last updated