jitsi/lib-jitsi-meet

conference.getBreakoutRooms().sendParticipantToRoom() Not working?

eddsaura opened this issue · 5 comments

Hi,

We are implementing breakout rooms in our app ( https://github.com/Stooa/Stooa ) and I can't make this function work. I get no logs or anything and after doing the sendParticipantToRoom I check rooms again and nothing happened.

We need to make something similar to the autoAssignToBreakoutRooms() function.

We are using last lib-jitsi-meet version.
"lib-jitsi-meet": "https://github.com/jitsi/lib-jitsi-meet/releases/download/v1640.0.0%2B8c9c4df5/lib-jitsi-meet.tgz"

So first of all, we are in a conference.

image

And then we create the room

const createBreakoutRoom = name => {
    if (!isModerator) {
      return;
    }
    try {
      conference.getBreakoutRooms().createBreakoutRoom(name);
    } catch (error) {
      throw new Error(error);
    }
  };

It works, now I have two rooms, the main and the second one.

image

Cool, now I want to send a participant to the second room, so we have this function.

  const sendParticipantToRoom = (participantJid, roomId) => {
    const { _rooms } = getBreakoutRooms();
    const room = _rooms[roomId];

    if (!room) {
      console.error(`Invalid room: ${roomId}`);

      return;
    }

    console.log('TRYING to move this guy', participantJid, 'to room', room.jid);
    conference.getBreakoutRooms().sendParticipantToRoom(participantJid, room.jid);
  };

This is what we get from that log.

TRYING to move this guy 834aefdd-cfa5-4372-8662-5e9c11eb7449@meet.jitsi/WlxC0OhX_Tsw to room ee45db44-196e-4e9d-bf6b-10364d7d81f5@breakout.meet.jitsi

Idk what to do.

You need to implement the actual joining in your app. That function will send a message which is turned into an event: BREAKOUT_ROOMS_MOVE_TO_ROOM. You can decide what to do there. Check how we handle it in Jitsi Meet.

thank you @saghul . So what is the sendParticipantToRoom() for? I think I don't get it hahah 😅

It sends that message indicating the target participant that it should move to that room.