arctos Web-SDK For developsarctos Web-SDK For develops
  • English
  • 繁體中文
  • English
  • 繁體中文
  • Guide

    • get-started
  • overview
  • Spec
  • installization
  • features

    • initial_setting
    • camera
    • microphone
    • speaker
    • share_screen
    • paint_board
    • share_message
    • switch_template
    • video_filters

Send messages between users

Publish message to room participants or to specific users.

// Sender of the message (after 'session.connect')

arctosSdkInstance.$meetingRoom.publishSignal({
      data: 'My custom message',               // Any string (optional)
      to: [],                                  // Array of Connection objects (optional. Broadcast to everyone if empty)
      type: 'MessageToModerator'               // The type of message (optional)
    })
    .then(() => {
        console.log('Message successfully sent');
    })
    .catch(error => {
        console.error(error);
    });

Subscribe to messages from other users:

// Receiver of the message (usually before calling 'session.connect')

arctosSdkInstance.$meetingRoom.subscribeSignal('MessageToModerator', (event) => {
    console.log(event.data); // Message
    console.log(event.from); // ConnectionId of the sender
});

You can also send private messages to specific users:

// Sender of the adressed message (after calling 'session.connect')

arctosSdkInstance.$meetingRoom.publishSignal({
    data: 'My private custom message',
    to: [connection1, connection2],
    type: 'MyPrivateChannel'
});

The following url is a sample code for joining a meeting room.

Sample Code


Prev
paint_board
Next
switch_template