MediaSFU Shared
    Preparing search index...

    Function assignParticipantToBreakoutRoom

    • Add, move, or remove one participant, without rebuilding the whole array.

      Covers all three cases the composition array makes awkward by hand: room: 1 adds them to room 1 (or moves them there from wherever they are), room: null removes them from breakout rooms entirely. Empty trailing rooms are preserved, because room numbers are positional and collapsing them would silently renumber everyone else.

      Parameters

      Returns Promise<{ ok: boolean; error: string }>

      await assignParticipantToBreakoutRoom({ parameters, name: 'Ada', room: 0 }); // add
      await assignParticipantToBreakoutRoom({ parameters, name: 'Ada', room: 1 }); // move 0 -> 1
      await assignParticipantToBreakoutRoom({ parameters, name: 'Ada', room: null }); // remove