Skip to main content
Version: 0.1.x

Send Messages

Whenever any participant wants to notify other participants via chat messages or Raise hand, they can simply do it with VideoSDK Meeting.

This guide will provide an overview of how to implement chat and raise hand in a meeting.

  1. Chat Message - If a participant wants to inform or notify something in current meeting, they can use sendChatMessage() function by providing {message:"Anything they wish to send"} object argument.

  2. Raised Hand - If a participant has some doubts during the meeting and wants to raise hand, they can use sendChatMessage() function by providing {type:"RAISE_HAND"} object argument.

note

sendChatMessage() function only takes string as an argument.

Send Message And Raised Hand

const onPress = () => {
// Sending Message
let data = {
message: "Hello World",
};
meeting?.sendChatMessage(JSON.stringify(data));

// Raising Hand
meeting?.sendChatMessage(JSON.stringify({ type: "RAISE_HAND", data: {} }));
};

Events

  1. chat-message - Whenever any participant sending message/raise hand in the meeting, then chat-message event will trigger and return senderId, senderName, timeStamp, text and type (RAISE_HAND/CHAT).
import { useMeeting } from "@videosdk.live/react-sdk";

/** useMeeting hooks events */
const {
/** Methods */
} = useMeeting({
onChatMessage: (messageData) => {
const { senderId, senderName, text } = messageData;

const { type, data } = JSON.parse(text);

// type can be "CHAT" or "RAISE_HAND"
},
});