arctos-SDK For developsarctos-SDK For develops
Home
Okuma
arctos
Contact
  • English
  • 繁體中文
Home
Okuma
arctos
Contact
  • English
  • 繁體中文
  • Guide

    • get-started
  • Spec

    • Peer to Peer Direct
    • Relay based
  • Api

    • Overview
    • Auth
    • Task
    • Business
    • Room
  • Peer to Peer Direct

    • overview
    • installization
    • features

      • initial_setting
      • room
      • camera
      • conference
      • microphone
      • speaker
      • share_screen
      • paint_board
      • recording
      • layout
  • Relay based

    • overview
    • 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