Room Metadata
All metadata pertaining to a meeting is stored in meeting.meta
. This includes:
roomName
: The name of the room the current participant is connected to.roomType
: Indicates the meeting is a group-call or a webinar.meetingTitle
: The title of the meeting.meetingStartedTimestamp
: The timestamp when the meeting started.
For example, if you want to get the name of the room the current participant is connected to, you can do so by doing:
// Destructuring the metadata to get roomName and joined
const { roomName } = meeting.meta;
if (meeting.self.roomJoined) {
console.log(`The local user has joined room ${roomName}.`);
}
The meta
object also emits for indicating the change in the connection state
of the room. For example, you can listen for the connected
event to know when
the local user has successfully joined the room, and for the disconnected
event to find out if the local user's connection has dropped.
meeting.meta.on('connected', () => {
console.log(
`The local user has successfully joined the room ${meeting.meta.roomName}`
);
});
meeting.meta.on('disconnected', () => {
console.log(
`The local user got disconnected from the room ${meeting.meta.roomName}`
);
});
meeting.meta.on('poorConnection', () => {
console.log(`The local user has poor network connection.`);
});
meeting.meta.on('connectionError', ({ reason }) => {
console.log(`Could not connect to the room.`);
});