# Subscribe video counts greater than maximum size (4)

**URL:** <https://devforum.zoom.us/t/subscribe-video-counts-greater-than-maximum-size-4/113916>\
**Category:** Web\
**Tags:** video-sdk\
**Created:** [July 18, 2024, 11:54am UTC](https://devforum.zoom.us/t/subscribe-video-counts-greater-than-maximum-size-4/113916 "2024-07-18T11:54:01Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![sergey77](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/sergey77/32/50255_2.png) [@sergey77](https://devforum.zoom.us/u/sergey77)\
**Post date:** [July 18, 2024, 11:54am UTC](https://devforum.zoom.us/t/subscribe-video-counts-greater-than-maximum-size-4/113916/1 "2024-07-18T11:54:01Z")

</div>

When there are more than 5 users on the stage (in the room), we’re getting the error in the method “attachVideo”:

```auto
subscribe video counts greater than maximum size (4)

```

Client:

```auto
    const zmClient = ZoomVideo.createClient();
    await ZoomVideo.preloadDependentAssets(`${window.location.origin}/lib`);
    await zmClient.init("en-US", `${window.location.origin}/lib`, {
        webEndpoint: window?.webEndpoint ?? "zoom.us",
        stayAwake: true,
        patchJsMedia: true,
        leaveOnPageUnload: true,
        enforceVirtualBackground: true,
        enforceMultipleVideos: true,
    })

```

**Zoom sessionId: “LbnScVdqQeO4ikNqnixUew==”**

SharedArrayBuffer **is disabled**  
Zoom Video SDK 1.11.10  
React 17.0.2

---

<div class="post-metadata">

**Author:** ![rehema.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/rehema.zoom/32/40323_2.png) [@rehema.zoom](https://devforum.zoom.us/u/rehema.zoom)\
**Post date:** [July 18, 2024, 2:41pm UTC](https://devforum.zoom.us/t/subscribe-video-counts-greater-than-maximum-size-4/113916/2 "2024-07-18T14:41:59Z")

</div>

Hi @sergey77,

I see you have `enforceMultipleVideos` set to true, but this only allows for 4 videos at max. To allow for gallery view with \>4 videos, you’ll need to enable [SharedArrayBuffer](https://developers.zoom.us/docs/video-sdk/web/sharedarraybuffer/).

Thanks,  
Rehema

---

<div class="post-metadata">

**Author:** ![sergey77](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/sergey77/32/50255_2.png) [@sergey77](https://devforum.zoom.us/u/sergey77)\
**Post date:** [July 18, 2024, 2:51pm UTC](https://devforum.zoom.us/t/subscribe-video-counts-greater-than-maximum-size-4/113916/3 "2024-07-18T14:51:41Z")

</div>

Hi @rehema.zoom ,

Is there a way to render more than 4 videos with SharedArrayBuffer turned off?

In our case, enabled SharedArrayBuffe leads to multiple issues related to CORS

---

<div class="post-metadata">

**Author:** ![rehema.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/rehema.zoom/32/40323_2.png) [@rehema.zoom](https://devforum.zoom.us/u/rehema.zoom)\
**Post date:** [July 18, 2024, 8:15pm UTC](https://devforum.zoom.us/t/subscribe-video-counts-greater-than-maximum-size-4/113916/4 "2024-07-18T20:15:29Z")

</div>

Hi @sergey77 ,

Unfortunately, over 4 videos cannot be rendered without SAB enabled. Is using serviceworkers, as described [here](https://developers.zoom.us/docs/video-sdk/web/sharedarraybuffer/#how-to-enable-sharedarraybuffer), an option for you all?

---

<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:** [July 19, 2024, 6:25am UTC](https://devforum.zoom.us/t/subscribe-video-counts-greater-than-maximum-size-4/113916/5 "2024-07-19T06:25:03Z")

</div>

Hey @sergey77

We have an exception where you can set `{disableRenderLimits: true}` in the `enforceMultipleVideos` attribute of the `client.init` method.

This allows you to render up to 25 videos simultaneously, but enabling this option may cause high CPU usage and video performance issues.

Thanks  
Vic

---

<div class="post-metadata">

**Author:** ![sergey77](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/sergey77/32/50255_2.png) [@sergey77](https://devforum.zoom.us/u/sergey77)\
**Post date:** [July 19, 2024, 9:27am UTC](https://devforum.zoom.us/t/subscribe-video-counts-greater-than-maximum-size-4/113916/6 "2024-07-19T09:27:16Z")

</div>

Hi @rehema.zoom ,

Our app uses a lot of content (video, images, etc.) from various sources that are not related to us. At the moment, enabling  
coi-serviceworker breaks the usage of third-party content sources in the app.

Is there a way to configure serviceworkers so that it only affects Zoom content? Or could you please advise how to resolve the issue with using video content and images from third-party sources (not related to the app) when using Cross-Origin Isolation or Credentialless Headers or Serviceworkers?

---

<div class="post-metadata">

**Author:** ![sergey77](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/sergey77/32/50255_2.png) [@sergey77](https://devforum.zoom.us/u/sergey77)\
**Post date:** [July 19, 2024, 9:33am UTC](https://devforum.zoom.us/t/subscribe-video-counts-greater-than-maximum-size-4/113916/7 "2024-07-19T09:33:31Z")

</div>

Hi @vic.yang ,  
Thanks for a hint.

Actually, I don’t think we need support for as many as 25 videos simultaneously. If we use a maximum of **6-9 videos** simultaneously, how critical is it for high CPU usage? If the usage of **6-9 videos** simultaneously doesn’t create performance issues, then the solution of using **{disableRenderLimits: true}** works for us

* * *

The second question is if using a separate **video-player-container** for each video will somehow affect the performance? That is, is there a difference in using:

```auto
<video-player-container>
     <video-player />
     <video-player />
     <video-player />
     <video-player />
     <video-player />
     <video-player />
</video-player-container>

```

Or

```auto
<div>
      <video-player-container>
           <video-player />
      </video-player-container>
      <video-player-container>
           <video-player />
      </video-player-container>
      <video-player-container>
           <video-player />
      </video-player-container>
      <video-player-container>
           <video-player />
      </video-player-container>
      <video-player-container>
           <video-player />
      </video-player-container>
      <video-player-container>
           <video-player />
      </video-player-container>
</div>

```

---

<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:** [July 19, 2024, 9:51am UTC](https://devforum.zoom.us/t/subscribe-video-counts-greater-than-maximum-size-4/113916/8 "2024-07-19T09:51:18Z")

</div>

Hey @sergey77

> If we use a maximum of **6-9 videos** simultaneously, how critical is it for high CPU usage?

It depends on the performance of different devices.

Our initial setting of 4 is conservative. On higher-performance devices (such as a MacBook Pro with an M1 chip), even with more than 10 videos, the video experience remains quite good. Due to the limited number of testing devices, we cannot provide a definitive answer.

> The second question is if using a separate **video-player-container** for each video will somehow affect the performance?

The former is the recommended approach.

Thanks  
Vic

---

<div class="post-metadata">

**Author:** ![sergey77](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/sergey77/32/50255_2.png) [@sergey77](https://devforum.zoom.us/u/sergey77)\
**Post date:** [July 19, 2024, 11:37am UTC](https://devforum.zoom.us/t/subscribe-video-counts-greater-than-maximum-size-4/113916/9 "2024-07-19T11:37:45Z")

</div>

Hi @vic.yang ,  
Is there any development to improve performance when using more than 4 videos **without SAB enabled**? I read that there is a release planned for August:

> [@Video SDK - web version - Mac OS performance](https://devforum.zoom.us/t/video-sdk-web-version-mac-os-performance/111719/12):
>
> Hey @kimdev , stay tuned, we have a release coming in August that will help you. Best, Tommy

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [July 19, 2024, 5:50pm UTC](https://devforum.zoom.us/t/subscribe-video-counts-greater-than-maximum-size-4/113916/10 "2024-07-19T17:50:16Z")

</div>

Hey @sergey77 ,

We are working on an improvement this fall to render more than 4 videos without SAB and with great performance. In the meantime, please use the `{disableRenderLimits: true}` in the `enforceMultipleVideos` attribute of the `client.init` method.

Best,  
Tommy

---

<div class="post-metadata">

**Author:** ![sergey77](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/sergey77/32/50255_2.png) [@sergey77](https://devforum.zoom.us/u/sergey77)\
**Post date:** [July 22, 2024, 12:23pm UTC](https://devforum.zoom.us/t/subscribe-video-counts-greater-than-maximum-size-4/113916/11 "2024-07-22T12:23:36Z")

</div>

Hi @tommy , thanks for the response.  
We’re looking forward to getting this update. This is really important to us

---

<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:** [August 21, 2024, 10:23pm UTC](https://devforum.zoom.us/t/subscribe-video-counts-greater-than-maximum-size-4/113916/12 "2024-08-21T22:23:44Z")

</div>

Closed on August 21, 2024, 10:23pm UTC

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