Skip to content

Latest commit

 

History

History
executable file
·
1366 lines (1039 loc) · 30.2 KB

File metadata and controls

executable file
·
1366 lines (1039 loc) · 30.2 KB
description Documentation for the two classes GuestVC and AdminVC with method descriptions

Documentation

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

{% hint style="info" %} It can be called anywhere in the code, but after defining an instance of this class {% endhint %}

Type Param Return
method - -

setVideoContainerForTestCamera

Desc: Set video container for testing to display camera

{% hint style="info" %} Use before testing starts {% endhint %}

Type Param Return
method elem HTML -

setCameraDevice

Desc: Set camera device

{% hint style="info" %} Use before connecting to the session {% endhint %}

Type Param Return
method string - device ID -

setMicroDevice

Desc: Set micro device

Type Param Return
method string - device ID -

{% hint style="info" %} Use before connecting to the session {% endhint %}

setSoundDevice

Desc: Set sound device

{% hint style="info" %} Use before connecting to the session {% endhint %}

Type Param Return
method string - device ID -

getMicroDevicesList

Desc: Get micro devices list

{% hint style="info" %} Use before connecting to the session {% endhint %}

Type Param Return
method - objects array

{

deviceId: "",

label: ""

}

getCameraDevicesList

Desc: Get camera devices list

{% hint style="info" %} Use before connecting to the session {% endhint %}

Type Param Return
method - objects array

{

deviceId: "",

label: ""

}

getSoundDevicesList

Desc: Get sound devices list

{% hint style="info" %} Use before connecting to the session {% endhint %}

Type Param Return
method - objects array

{

deviceId: "",

label: ""

}

getCurrentCameraDevice

Desc: get current camera device ID

{% hint style="info" %} Use before connecting to the session {% endhint %}

Type Param Return
method - string

getCurrentSoundDevice

Desc: get current sound device ID

{% hint style="info" %} Use before connecting to the session {% endhint %}

Type Param Return
method - string

getCurrentMicroDevice

Desc: get current micro device ID

{% hint style="info" %} Use before connecting to the session {% endhint %}

Type Param Return
method - string

startTest

Desc: Start testing devices

{% hint style="info" %} Use before connecting to the session {% endhint %}

Type Param Return
method - -

stopTest

Desc: Stop testing devices

{% hint style="info" %} Use before connecting to the session {% endhint %}

Type Param Return
method - -

setElementHTMLMessages

Desc: Set elem HTML for display chat

{% hint style="info" %} It can be called anywhere in the code, but after defining an instance of this class {% endhint %}

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

{% hint style="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 {% endhint %}

microOff

Desc: Disable micro

{% hint style="info" %} It can be called anywhere in the code, but after defining an instance of this class {% endhint %}

Type Param Return
method - -

microOn

Desc: Enable micro

{% hint style="info" %} It can be called anywhere in the code, but after defining an instance of this class {% endhint %}

Type Param Return
method - -

localCameraOff

Desc: Disable local camera

{% hint style="info" %} It can be called anywhere in the code, but after defining an instance of this class {% endhint %}

Type Param Return
method - -

localCameraOn

Desc: Enable local camera

{% hint style="info" %} It can be called anywhere in the code, but after defining an instance of this class {% endhint %}

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

{% hint style="info" %} Must call before connect {% endhint %}

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

{% hint style="info" %} Must call before connect {% endhint %}

Type Param Return
method HTML elem for display local camera -

setConnectBtnUI

Desc: Set callbacks for changing button state

{% hint style="info" %} Must call before connect {% endhint %}

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

onUserStatusChanged

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

{% hint style="info" %} Be sure to add at the end of the code {% endhint %}

Type Param Return
method - -

onRoomFull

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

{% hint style="info" %} Be sure to add at the end of the code {% endhint %}

Type Param Return
event - -

onStream

Desc: Event handler that handle stream

{% hint style="info" %} Be sure to add at the end of the code {% endhint %}

Type Param Return
event - -

onMediaError

Desc: Event handler that handle stream error

{% hint style="info" %} Be sure to add at the end of the code {% endhint %}

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

{% hint style="info" %} Use before testing starts {% endhint %}

Type Param Return
method elem HTML -

setCameraDevice

Desc: Set camera device

{% hint style="info" %} Use before connecting to the session {% endhint %}

Type Param Return
method string - device ID -

setMicroDevice

Desc: Set micro device

Type Param Return
method string - device ID -

{% hint style="info" %} Use before connecting to the session {% endhint %}

setSoundDevice

Desc: Set sound device

{% hint style="info" %} Use before connecting to the session {% endhint %}

Type Param Return
method string - device ID -

getMicroDevicesList

Desc: Get micro devices list

{% hint style="info" %} Use before connecting to the session {% endhint %}

Type Param Return
method - string array

getCameraDevicesList

Desc: Get camera devices list

{% hint style="info" %} Use before connecting to the session {% endhint %}

Type Param Return
method - string array

getSoundDevicesList

Desc: Get sound devices list

{% hint style="info" %} Use before connecting to the session {% endhint %}

Type Param Return
method - string array

getCurrentCameraDevice

Desc: get current camera device ID

{% hint style="info" %} Use before connecting to the session {% endhint %}

Type Param Return
method - string

getCurrentSoundDevice

Desc: get current sound device ID

{% hint style="info" %} Use before connecting to the session {% endhint %}

Type Param Return
method - string

getCurrentMicroDevice

Desc: get current micro device ID

{% hint style="info" %} Use before connecting to the session {% endhint %}

Type Param Return
method - string

startTest

Desc: Start testing devices

{% hint style="info" %} Use before connecting to the session {% endhint %}

Type Param Return
method - -

stopTest

Desc: Stop testing devices

{% hint style="info" %} Use before connecting to the session {% endhint %}

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

{% hint style="info" %} Must call before connect {% endhint %}

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

{% hint style="info" %} Must call before connect {% endhint %}

Type Param Return
method HTML elem for display local camera -
HTML elem for display screen

setContentViewContainer

Desc: Set HTML elems for copy children

{% hint style="info" %} Must call before connect {% endhint %}

Type Param Return
method HTML elem -

setElementHTMLMessages

Desc: Set elem HTML for display chat

{% hint style="info" %} Must call before connect {% endhint %}

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

{% hint style="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 {% endhint %}

setConnectBtnUI

Desc: Set callbacks for changing button state

{% hint style="info" %} Must call before connect {% endhint %}

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

{% hint style="info" %} It can be called anywhere in the code, but after defining an instance of this class {% endhint %}

Type Param Return
method - bool
true - if success start
false - if error

screenRecordingOff

Desc: turn on screen recorder

{% hint style="info" %} It can be called anywhere in the code, but after defining an instance of this class {% endhint %}

Type Param Return
method callback(blob) bool
true - if success end
false - if error

microOff

Desc: Disable micro

{% hint style="info" %} It can be called anywhere in the code, but after defining an instance of this class {% endhint %}

Type Param Return
method - -

microOn

Desc: Enable micro

{% hint style="info" %} It can be called anywhere in the code, but after defining an instance of this class {% endhint %}

Type Param Return
method - -

screenShareOn

Desc: Enable screen sharing

{% hint style="info" %} It can be called anywhere in the code, but after defining an instance of this class {% endhint %}

Type Param Return
method - -

screenShareOff

Desc: Disable screen sharing

{% hint style="info" %} It can be called anywhere in the code, but after defining an instance of this class {% endhint %}

Type Param Return
method - -

localCameraOff

Desc: Disable local camera

{% hint style="info" %} It can be called anywhere in the code, but after defining an instance of this class {% endhint %}

Type Param Return
method - -

localCameraOn

Desc: Enable local camera

{% hint style="info" %} It can be called anywhere in the code, but after defining an instance of this class {% endhint %}

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

{% hint style="info" %} It can be called anywhere in the code, but after defining an instance of this class {% endhint %}

Type Param Return
method - -

connect

Desc: Create room

Type Param Return
method - -

getInstance

Desc: Get instance of class AdminVC

Type Param Return
method - AdminVC

onUserStatusChanged

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

{% hint style="info" %} Be sure to add at the end of the code {% endhint %}

Type Param Return
event - -

onStream

Desc: Event handler that handle stream

{% hint style="info" %} Be sure to add at the end of the code {% endhint %}

Type Param Return
event - -

onMediaError

Desc: Event handler that handle stream error

{% hint style="info" %} Be sure to add at the end of the code {% endhint %}

Type Param Return
event - -

onMessage

Desc: Event handler for massage from guests

{% hint style="info" %} Be sure to add at the end of the code {% endhint %}

Type Param Return
event callback -