# On rejoining same session I am getting error: subscribe video counts greater than maximum size (1)

**URL:** <https://devforum.zoom.us/t/on-rejoining-same-session-i-am-getting-error-subscribe-video-counts-greater-than-maximum-size-1/107615>\
**Category:** Web\
**Created:** [April 10, 2024, 9:49am UTC](https://devforum.zoom.us/t/on-rejoining-same-session-i-am-getting-error-subscribe-video-counts-greater-than-maximum-size-1/107615 "2024-04-10T09:49:58Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ashok.kumar](https://avatars.discourse-cdn.com/v4/letter/a/f1d935/32.png) [@ashok.kumar](https://devforum.zoom.us/u/ashok.kumar)\
**Post date:** [April 10, 2024, 9:49am UTC](https://devforum.zoom.us/t/on-rejoining-same-session-i-am-getting-error-subscribe-video-counts-greater-than-maximum-size-1/107615/1 "2024-04-10T09:49:58Z")

</div>

After leaving the zoom call, when I join the same sesssion again I am getting error: subscribe video counts greater than maximum size (1) for user who didn’t left the session and not able to see the video feed for the joining participant.

code for leaving call:

```auto
 const leaveSession = async () => {
    if (stream) {
      await client.getMediaStream().stopVideo();
      stream.stop();
    }
    await client.leave();
    navigate('/dashboard');
  };

```

for user how is still in call i am calling an event to clear canvas

```auto
client.on('user-removed', (payload) => {
    console.log('-- Here user-removed --', payload);
    stream?.stopRenderVideo('#participant-video-canvas', payload[0]?.userId);
  });

```

* * *

**Device (please complete the following information):**

- Device: HP pavilion 15
- OS: windows 11
- Browser: brave

---

<div class="post-metadata">

**Author:** ![kellyjandrews](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/kellyjandrews/32/51599_2.png) [@kellyjandrews](https://devforum.zoom.us/u/kellyjandrews)\
**Post date:** [April 10, 2024, 1:48pm UTC](https://devforum.zoom.us/t/on-rejoining-same-session-i-am-getting-error-subscribe-video-counts-greater-than-maximum-size-1/107615/2 "2024-04-10T13:48:33Z")

</div>

> [@ashok.kumar](#):
>
> ```auto
> await client.getMediaStream().stopVideo();
> stream.stop();
> 
> ```

I see two things here -

1. `stream.stop()` - I’m not sure if this is referencing the MediaStream object, but `stop` isn’t a method here - is this what you were wanting to call here?
2. I’m not 100% sure that calling `getMediaStream()` here is getting the same stream you already have or creating a new one (again - not sure - but will test that out later)? If you already have the `stream` object referenced, use the same one and see if that helps.

Stopping the rendered video is not going to remove it - you would also need to redraw the screen without the removed video.

Let me know if this helps - this isn’t an error I’ve come across yet - but will try to reproduce it if I can.

---

<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:** [April 11, 2024, 2:04am UTC](https://devforum.zoom.us/t/on-rejoining-same-session-i-am-getting-error-subscribe-video-counts-greater-than-maximum-size-1/107615/3 "2024-04-11T02:04:32Z")

</div>

Hey @ashok.kumar

Usually, the issue arises because the page doesn’t enable `SharedArrayBuffer`, and the `enforceMultipleVideos` option is not specified in the `client.init `method.

> **[Video SDK - web - SharedArrayBuffer](https://developers.zoom.us/docs/video-sdk/web/sharedarraybuffer/)**
>
> 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.

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

In this situation, a canvas can only render one video. The simplest solution would be to set `enforceMultipleVideos` to `true` to address your issue.

Thanks  
Vic

---

<div class="post-metadata">

**Author:** ![ashok.kumar](https://avatars.discourse-cdn.com/v4/letter/a/f1d935/32.png) [@ashok.kumar](https://devforum.zoom.us/u/ashok.kumar)\
**Post date:** [April 11, 2024, 12:43pm UTC](https://devforum.zoom.us/t/on-rejoining-same-session-i-am-getting-error-subscribe-video-counts-greater-than-maximum-size-1/107615/4 "2024-04-11T12:43:22Z")

</div>

thanks @kellyjandrews for responding. I was looking for stream.detachVideo(userId) and end up calling stop() from nowhere.

---

<div class="post-metadata">

**Author:** ![ashok.kumar](https://avatars.discourse-cdn.com/v4/letter/a/f1d935/32.png) [@ashok.kumar](https://devforum.zoom.us/u/ashok.kumar)\
**Post date:** [April 11, 2024, 12:45pm UTC](https://devforum.zoom.us/t/on-rejoining-same-session-i-am-getting-error-subscribe-video-counts-greater-than-maximum-size-1/107615/5 "2024-04-11T12:45:35Z")

</div>

thanks @vic.yang,  
enforceMultipleVideos: true resolved my issue.

```auto
client.init('en-US', 'Global', { patchJsMedia: true, enforceMultipleVideos: true })

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [May 11, 2024, 10:46pm UTC](https://devforum.zoom.us/t/on-rejoining-same-session-i-am-getting-error-subscribe-video-counts-greater-than-maximum-size-1/107615/6 "2024-05-11T22:46:13Z")

</div>

Closed on May 11, 2024, 10:46pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
