Custom dailyjs and breakout rooms

Hi daily bros, i would like to ask if it's possible to create breakout rooms using the custom dailyjs callObject. I understand that these rooms are mini rooms inside the main room but there are some concepts that i don't have clear. Some advices will be useful, thank you so much

Answers

  • kwindla
    kwindla Dailynista

    Hi,

    Yes, it's definitely possible.

    There are two approaches. The first is to move people into separate Daily rooms for the breakouts and then back into the main room. The second approach is to use track subscriptions to implement "breakout rooms."

    If you have your own backend that is keeping track of users and events, you might want to move users into different rooms. This should be fairly simple to implement if you're already managing user state for your app.

    On the other hand, using track subscriptions provides more flexibility. You can have audio or video tracks that are sent to all the breakout rooms with this approach. For example, a moderator can make announcements to every breakout room this way. But you'll need to become familiar with our track subscriptions methods:

    https://docs.daily.co/reference/rn-daily-js/instance-methods/update-participant#track-subscriptions

  • isra
    isra Member
    edited December 2022

    Hi @kwindla thanks for your response, I'm curious about the first approach with a stage management and the events, As the daily demos and a normal project, there is a global management tool for all of what is happening in the videocall, with the state and all that. The problem that i'm facing is that my states work correctly in the main room as expected, but it's the same state with the breakouts room, they are like a mirror, what i do in the main room reflects in the breakout room (this breakout is another div container or another route and live in another part of the app). With 2 then 3, etc the breakout have to have their own state right? a chat for example could be different, the screen sharing and more. How can i achieve this? Give me some idea or advice please. Breakout rooms weren't in the plans when i started the project and maybe even the structure of the app could be wrong, you know.

  • Hi @isra! I'll try to add on to what Kwindla said above.

    In either breakout room approach (either "separate Daily rooms" or "track subscriptions") you'll need to keep track of which room a user is in, and manage their state appropriately.

    For separate Daily rooms, users will need to leave() then join() a different Daily room, so the state might include which room they came from, and which room they are moving into. You can use the /presence REST API to assist with this, for example: https://docs.daily.co/reference/rest-api/presence

    For the track subscriptions approach, all users stay in the same Daily room, so they only join() once at the start and leave() once at the end. To switch between breakout rooms, you'll need to manually manage each participant's track subscriptions. In this case, the state for each user might include what breakout room they're in, and the other participants in the same room so that the subscribed tracks can be updated. The docs for subscribeToTracksAutomatically() would be useful here.