Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace ChatClient

The chat interface provides the methods define the chat behavior

The chat object can be accessed by getFeatureModule method of a ZoomMeeting instance.

const client = ZoomMeeting.createClient();
client.init(
apiKey,
makeSignature(),
...,
['chat'], // to enable chat interface
);
client.join(meetingNumber, 'test', '', 'test@test.com')

after joining meeting success, chat interface is available

const chat = client.getFeatureModule('chat');
if (chat) {
 chat.getHistory(); // chat methods can be used now
}
// start to receive chat message
client.on('chat-on-message', (v) => {
 console.log(v);
 // do something
})

Index

Functions

getHistory

  • get the history chat list

    example

    const historyChatList = chat.getHistory();
    console.log(historyChatList);
    

    Returns ChatMessage[]

getPrivilege

  • getPrivilege(): number
  • return the current privilege value

    example

    const privilege = chat.getPrivilege();
    console.log(privilege);
    

    Returns number

getReceivers

send

  • send(text: string, userId: number): Promise<ChatMessage | Error>
  • send chat message to other

    example

     chat.sendMessage('test', userId)
     .then(() => {
         // success
     })
        .catch(v => {
         // fail
         console.log(v)
     })
    

    Parameters

    • text: string
    • userId: number

    Returns Promise<ChatMessage | Error>

    • ChatMessage: success
    • Error: Failure. Following the details of Error:
      • IMPROPER_MEETING_STATE: It works only when user is in meeting
      • INSUFFICIENT_PRIVILEGES: chat privilege limited
      • INVALID_PARAMETERS: invalid parameter

sendToAll

  • sendToAll(text: string): Promise<ChatMessage | Error>
  • Send message to everyone

    Parameters

    • text: string

      message

    Returns Promise<ChatMessage | Error>

    ExecutedPromise

setPrivilege

  • host or co-Host use it to change chat privilege which defines what kind of role of user that attendee can talk to, there are the different privilege as following.

    privilege value describe
    meeting ChatPrivilege.All attendee can talk to everyone
    ChatPrivilege.NoOne attendee can talk to no one
    ChatPrivilege.EveryonePublicly attendee can talk to host, manager and everyone

    example

    chat.setPrivilege(ChatPrivilege.All)
    .then((v) => {
         const { chatPrivilege } = v;
         // success
     })
    .catch(v => {
         // fail
         console.log(v)
     })
    

    Parameters

    • privilege: number

    Returns ExecutedResult

    executedPromise

Generated using TypeDoc