Waiting Room
After you call .join() on meeting, you either get a roomJoined event if you are allowed to join or a waitlisted event.
Use the self.roomState to track the user's state in the meeting.
This diagram only represents the waiting room related states, the roomState property also transitions through other states
Each of these state changes generate their own events.
- joined
 
- Javascript
 - React
 
meeting.self.on('roomJoined', () => {
  // local user is in the meeting
});
const roomState = useDyteSelector((m) => m.self.roomState);
const joined = roomState === 'joined';
Alternatively
meeting.self.on('roomJoined', () => {
  // local user is in the meeting
});
- waitlisted
 
- Javascript
 - React
 
meeting.self.on('waitlisted', () => {
  // local user is waitlisted
});
const roomState = useDyteSelector((m) => m.self.roomState);
const isWaitlisted = roomState === 'waitlisted';
Alternatively
meeting.self.on('waitlisted', () => {
  // local user is waitlisted
});
- rejected
 
- Javascript
 - React
 
meeting.self.on('roomLeft', ({ state }) => {
  // state = rejected when host rejects the entry
});
const roomState = useDyteSelector((m) => m.self.roomState);
const rejected = roomState === 'rejected';
Alternatively
meeting.self.on('roomLeft', ({ state }) => {
  // state = rejected when host rejects the entry
});
Host can use these methods to accept/reject participants