# Participants from different subsessions can interact with each other

**URL:** <https://devforum.zoom.us/t/participants-from-different-subsessions-can-interact-with-each-other/120022>\
**Category:** Video SDK\
**Tags:** video-sdk\
**Created:** [October 29, 2024, 9:13pm UTC](https://devforum.zoom.us/t/participants-from-different-subsessions-can-interact-with-each-other/120022 "2024-10-29T21:13:44Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![dev\_lxpead](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/dev_lxpead/32/63797_2.png) [@dev\_lxpead](https://devforum.zoom.us/u/dev_lxpead)\
**Post date:** [October 29, 2024, 9:13pm UTC](https://devforum.zoom.us/t/participants-from-different-subsessions-can-interact-with-each-other/120022/1 "2024-10-29T21:13:44Z")

</div>

All integrations were made following the Zoom Video SDK documentation.  
I’m having some unsolved issues in the documentation.

Even if participants are in different subsessions, they can hear, view cameras and share screens from participants in another subsession.

In addition to inserting participants into different subsessions, is it necessary to take any other action so that they are in separate environments? The idea is that the participant can only hear, see the camera and share the screen of the participants in the same subsession.

I created a logic that, based on the group that a user has in my system, subsessions were created and when entering the session the participants were already inserted in them. For this to work I needed to implement a step by step that:

1. Opens all subsessions
2. Inserts the user into the subsession corresponding to the group with the same title
3. Closes all subsessions

The code snippet that does this is this:

```auto
const checkOrCreateSubsession = async (client, subsessionClient, userGroup, userId) => {
    if (subsessionClient && userGroup) {
        const currentSubsessionClient = client.getSubsessionClient()
        const subsessionsList = currentSubsessionClient.getSubsessionList()
        if (currentSubsessionClient) {
            const groupExists = subsessionsList?.find(i => i?.subsessionName === userGroup)
            if (!groupExists) {
                const response = await handleCreateSubsessions(subsessionClient, userGroup)
                const newSubsessionId = response[0]?.subsessionId
                if (newSubsessionId && userId) {
                    await currentSubsessionClient.openSubsessions(subsessionClient.getSubsessionList())
                    await assignUserToSubsession(currentSubsessionClient, userId, newSubsessionId)
                    await closeSubsessions(subsessionClient)
                }
            }
        }
    }
}

```

Below is more information about the versions and system I am using:  
Video SDK version: 1.12.5  
React version: 18  
Next JS version: 14.2.2  
OS: Windows 11  
Browser: Google Chrome  
Browser Version 129.0.6668.70 (Official Build) (64 bits)

---

<div class="post-metadata">

**Author:** ![vic.yang](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/vic.yang/32/24656_2.png) [@vic.yang](https://devforum.zoom.us/u/vic.yang)\
**Post date:** [October 30, 2024, 1:48am UTC](https://devforum.zoom.us/t/participants-from-different-subsessions-can-interact-with-each-other/120022/2 "2024-10-30T01:48:14Z")

</div>

Hey @dev_lxpead

Thanks for your feedback.

From the phenomenon you described, it appears that participants were only assigned to the subsession but did not join it.

In the `openSubsessions` method, there is an option to control whether participants automatically enter the subsession after being assigned, with the default value set to `false`. In this case, participants assigned to a subsession will receive the `subsession-invite-to-join` event, and in the callback for handling this event, the `joinSubsession` method can be called to join the assigned subsession.

Of course, if automatic join into the subsession is needed, you can specify the `isAutoJoinSubsession` option as `true` in the `openSubsessions` method.

> **[SubsessionOption | Zoom Video SDK for Web - 1.12.10](https://marketplacefront.zoom.us/sdk/custom/web/interfaces/SubsessionOption.html#isAutoJoinSubsession)**
>
> Documentation for Zoom Video SDK for Web - 1.12.10

Thanks  
Vic

---

<div class="post-metadata">

**Author:** ![binesh.dhami](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/binesh.dhami/32/40381_2.png) [@binesh.dhami](https://devforum.zoom.us/u/binesh.dhami)\
**Post date:** [October 30, 2024, 5:17pm UTC](https://devforum.zoom.us/t/participants-from-different-subsessions-can-interact-with-each-other/120022/3 "2024-10-30T17:17:40Z")

</div>

@dev_lxpead - Vic is referring to the join subsession function mentioned in the below link

> **[Video SDK - web - Subsessions - Zoom Developers](https://developers.zoom.us/docs/video-sdk/web/subsessions/#join-subsession)**
>
> The Zoom Developer Platform is an open platform that allows third-party developers to build applications and integrations upon Zoom’s video-first unified communications platform.

---

<div class="post-metadata">

**Author:** ![dev\_lxpead](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/dev_lxpead/32/63797_2.png) [@dev\_lxpead](https://devforum.zoom.us/u/dev_lxpead)\
**Post date:** [November 7, 2024, 1:45pm UTC](https://devforum.zoom.us/t/participants-from-different-subsessions-can-interact-with-each-other/120022/4 "2024-11-07T13:45:12Z")

</div>

Hello! I applied the suggested fixes but the interaction between subrooms still happens.  
I looked in the documentation and couldn’t find a way to confirm if the user actually entered the subroom. Is there a way to check this?

---

<div class="post-metadata">

**Author:** ![dev\_lxpead](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/dev_lxpead/32/63797_2.png) [@dev\_lxpead](https://devforum.zoom.us/u/dev_lxpead)\
**Post date:** [November 7, 2024, 10:00pm UTC](https://devforum.zoom.us/t/participants-from-different-subsessions-can-interact-with-each-other/120022/5 "2024-11-07T22:00:29Z")

</div>

Can the host communicate with all users in the session and also those in subsessions? I ask because in my tests, users in a subsession cannot hear the host.

---

<div class="post-metadata">

**Author:** ![binesh.dhami](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/binesh.dhami/32/40381_2.png) [@binesh.dhami](https://devforum.zoom.us/u/binesh.dhami)\
**Post date:** [November 7, 2024, 10:48pm UTC](https://devforum.zoom.us/t/participants-from-different-subsessions-can-interact-with-each-other/120022/6 "2024-11-07T22:48:17Z")

</div>

Hi Yan,

Please use the function subsession.getSubsessionList() for getting a list of all sub session along with users present in the sub session.

> **[Video SDK - web - Subsessions - Zoom Developers](https://developers.zoom.us/docs/video-sdk/web/subsessions/#list-users-in-a-subsession)**
>
> The Zoom Developer Platform is an open platform that allows third-party developers to build applications and integrations upon Zoom’s video-first unified communications platform.

---

<div class="post-metadata">

**Author:** ![binesh.dhami](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/binesh.dhami/32/40381_2.png) [@binesh.dhami](https://devforum.zoom.us/u/binesh.dhami)\
**Post date:** [November 7, 2024, 10:56pm UTC](https://devforum.zoom.us/t/participants-from-different-subsessions-can-interact-with-each-other/120022/7 "2024-11-07T22:56:26Z")

</div>

Hi Yan,

Additionally you can use the function startBroadcastVoice() and stopBroadcastVoice() to broadcast voice from main session to sub sessions.

> **[SubsessionClient | Zoom Video SDK for Web - 1.12.12](https://marketplacefront.zoom.us/sdk/custom/web/modules/SubsessionClient.html#startBroadcastVoice)**
>
> Documentation for Zoom Video SDK for Web - 1.12.12

---

<div class="post-metadata">

**Author:** ![dev\_lxpead](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/dev_lxpead/32/63797_2.png) [@dev\_lxpead](https://devforum.zoom.us/u/dev_lxpead)\
**Post date:** [November 7, 2024, 11:02pm UTC](https://devforum.zoom.us/t/participants-from-different-subsessions-can-interact-with-each-other/120022/8 "2024-11-07T23:02:14Z")

</div>

Thank you very much for your feedback @binesh.dhami !  
With this command, will all users in all subsessions be able to hear each other? Or will they only hear the host?

---

<div class="post-metadata">

**Author:** ![binesh.dhami](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/binesh.dhami/32/40381_2.png) [@binesh.dhami](https://devforum.zoom.us/u/binesh.dhami)\
**Post date:** [November 7, 2024, 11:30pm UTC](https://devforum.zoom.us/t/participants-from-different-subsessions-can-interact-with-each-other/120022/9 "2024-11-07T23:30:36Z")

</div>

Hi Yan,

All the participants in the subsession won’t be able to hear each other with this command. They will only hear the person from the main session.

Thank you,  
binesh

---

<div class="post-metadata">

**Author:** ![dev\_lxpead](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/dev_lxpead/32/63797_2.png) [@dev\_lxpead](https://devforum.zoom.us/u/dev_lxpead)\
**Post date:** [November 14, 2024, 8:26pm UTC](https://devforum.zoom.us/t/participants-from-different-subsessions-can-interact-with-each-other/120022/10 "2024-11-14T20:26:53Z")

</div>

> [@binesh.dhami](#):
>
> startBroadcastVoice

Thanks for the feedback!  
The start Broadcast Voice function worked perfectly, would it be possible to do the same to display the camera and the screen being shared by the host?

---

<div class="post-metadata">

**Author:** ![dev\_lxpead](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/dev_lxpead/32/63797_2.png) [@dev\_lxpead](https://devforum.zoom.us/u/dev_lxpead)\
**Post date:** [November 14, 2024, 8:28pm UTC](https://devforum.zoom.us/t/participants-from-different-subsessions-can-interact-with-each-other/120022/11 "2024-11-14T20:28:12Z")

</div>

> [@vic.yang](#):
>
> `isAutoJoinSubsession`

Thanks for the feedback!  
By setting isAutoJoinSubsession to true I was able to make it work. In my code there was a validation that was getting in the way of this implementation. When I fixed it, everything started working.

---

<div class="post-metadata">

**Author:** ![binesh.dhami](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/binesh.dhami/32/40381_2.png) [@binesh.dhami](https://devforum.zoom.us/u/binesh.dhami)\
**Post date:** [November 18, 2024, 10:21pm UTC](https://devforum.zoom.us/t/participants-from-different-subsessions-can-interact-with-each-other/120022/12 "2024-11-18T22:21:21Z")

</div>

Hi Yan,

The broadcast function can be used to display the content in the main session to all sub session.  
link: [SubsessionClient | Zoom Video SDK for Web - 1.12.12](https://marketplacefront.zoom.us/sdk/custom/web/modules/SubsessionClient.html#broadcast)

Thanks  
Binesh

---

<div class="post-metadata">

**Author:** ![dev\_lxpead](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/dev_lxpead/32/63797_2.png) [@dev\_lxpead](https://devforum.zoom.us/u/dev_lxpead)\
**Post date:** [November 19, 2024, 9:32pm UTC](https://devforum.zoom.us/t/participants-from-different-subsessions-can-interact-with-each-other/120022/13 "2024-11-19T21:32:33Z")

</div>

> [@binesh.dhami](#):
>
> startBroadcastVoice

Thanks for getting back @binesh.dhami !  
So how can I retrieve the host information when it calls the startBroadcastVoice function?

I haven’t found a way for a user to retrieve this information to display the host container again.

---

<div class="post-metadata">

**Author:** ![dev\_lxpead](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/dev_lxpead/32/63797_2.png) [@dev\_lxpead](https://devforum.zoom.us/u/dev_lxpead)\
**Post date:** [November 19, 2024, 10:03pm UTC](https://devforum.zoom.us/t/participants-from-different-subsessions-can-interact-with-each-other/120022/14 "2024-11-19T22:03:58Z")

</div>

The documentation states that I only need to send a string in the broadcast function:  
broadcast(content: string)

But how can I use this to render the camera or screen sharing for users within subsessions?

---

<div class="post-metadata">

**Author:** ![dev\_lxpead](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/dev_lxpead/32/63797_2.png) [@dev\_lxpead](https://devforum.zoom.us/u/dev_lxpead)\
**Post date:** [November 22, 2024, 9:55pm UTC](https://devforum.zoom.us/t/participants-from-different-subsessions-can-interact-with-each-other/120022/15 "2024-11-22T21:55:33Z")

</div>

Hello! I found the shareToSubsession function in the documentation. I believe that with it I will be able to display screen sharing with users who are in subsessions. However, I did not find many details on how to use the return of this function.  
I am getting the following error when calling this function:

```auto
{
    "type": "INVALID_PARAMETERS",
    "reason": "Expected to accept HTMLCanvasElement, but actual it is BA"
}

```

Is there a way to control whether the container that should display the video is a canvas?

---

<div class="post-metadata">

**Author:** ![vic.yang](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/vic.yang/32/24656_2.png) [@vic.yang](https://devforum.zoom.us/u/vic.yang)\
**Post date:** [November 25, 2024, 1:50am UTC](https://devforum.zoom.us/t/participants-from-different-subsessions-can-interact-with-each-other/120022/16 "2024-11-25T01:50:21Z")

</div>

Hey @dev_lxpead

This is a sender-side method that can be specified in the `stream.startShareScreen` method or enabled after starting screen sharing using the `media.shareToSubsession` method.

> **[ScreenShareOption | Zoom Video SDK for Web - 1.12.12](https://marketplacefront.zoom.us/sdk/custom/web/interfaces/ScreenShareOption.html#broadcastToSubsession)**
>
> Documentation for Zoom Video SDK for Web - 1.12.12

As for the `INVALID_PARAMETERS` error you mentioned, it may be thrown by another method, since the `media.shareToSubsession` method does not require any parameters.

Thanks  
Vic

---

<div class="post-metadata">

**Author:** ![dev\_lxpead](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/dev_lxpead/32/63797_2.png) [@dev\_lxpead](https://devforum.zoom.us/u/dev_lxpead)\
**Post date:** [December 12, 2024, 4:48pm UTC](https://devforum.zoom.us/t/participants-from-different-subsessions-can-interact-with-each-other/120022/17 "2024-12-12T16:48:30Z")

</div>

Hello!  
Can you explain to me how broadcasting works? I would also like to better understand how the client and stream work. By understanding these three concepts better, I believe I can find a solution to this problem, as I don’t know how to use the feedback that Zoom sends me to correctly render the camera and the host’s screen sharing.

---

<div class="post-metadata">

**Author:** ![vic.yang](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/vic.yang/32/24656_2.png) [@vic.yang](https://devforum.zoom.us/u/vic.yang)\
**Post date:** [December 23, 2024, 8:07am UTC](https://devforum.zoom.us/t/participants-from-different-subsessions-can-interact-with-each-other/120022/18 "2024-12-23T08:07:23Z")

</div>

Hey @dev_lxpead

> Can you explain to me how broadcasting works?

We provide several approaches for the host to broadcast to subsessions:

- **Text Messages** : Use `subsessionClient.broadcast(message)` for text-only communication.

- **Audio Voice** : Use `subsessionClient.startBroadcastVoice()` to start and `subsessionClient.stopBroadcastVoice()` to stop broadcasting audio. This feature is available only when the host is in the main session.

- **Screen Sharing** : Use `media.shareToSubsession` to share the screen. This feature is available only when the host is in the main session.

- **Video** : We currently don’t support it.

Thanks  
Vic

---

<div class="post-metadata">

**Author:** ![dev\_lxpead](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/dev_lxpead/32/63797_2.png) [@dev\_lxpead](https://devforum.zoom.us/u/dev_lxpead)\
**Post date:** [January 8, 2025, 8:40pm UTC](https://devforum.zoom.us/t/participants-from-different-subsessions-can-interact-with-each-other/120022/19 "2025-01-08T20:40:42Z")

</div>

Thanks for the feedback!  
I’m trying to use media.shareToSubsession but without any results. I’m not getting an error or success response when the method is called.

 ![Captura de tela 2025-01-08 171409](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/9/4/9483fe60fca3ff3cd83d2cf6091322e9af6a20f1.png)

After calling this method, is there any logic required to display screen sharing to users inside the subroom?

---

<div class="post-metadata">

**Author:** ![vic.yang](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/vic.yang/32/24656_2.png) [@vic.yang](https://devforum.zoom.us/u/vic.yang)\
**Post date:** [January 9, 2025, 2:39am UTC](https://devforum.zoom.us/t/participants-from-different-subsessions-can-interact-with-each-other/120022/20 "2025-01-09T02:39:33Z")

</div>

Hey @dev_lxpead

> media.shareToSubsession

It’s a method for switching functionality. It allows you to control whether to share the screen content to the subsession after initiating screen sharing.

Therefore, the prerequisite is that the host must first share the screen using `stream.startScreenShare`.

Could you help check whether the `stream.startScreenShare` method was called first?

Thanks  
Vic

[Next page](https://devforum.zoom.us/t/participants-from-different-subsessions-can-interact-with-each-other/120022.md?page=2)
