# User videos not rendering sometimes in Gallery mode (video component)

**URL:** <https://devforum.zoom.us/t/user-videos-not-rendering-sometimes-in-gallery-mode-video-component/93132>\
**Category:** Video SDK\
**Created:** [August 8, 2023, 9:21pm UTC](https://devforum.zoom.us/t/user-videos-not-rendering-sometimes-in-gallery-mode-video-component/93132 "2023-08-08T21:21:53Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![DaleAtMarvin](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/daleatmarvin/32/50392_2.png) [@DaleAtMarvin](https://devforum.zoom.us/u/DaleAtMarvin)\
**Post date:** [August 8, 2023, 9:21pm UTC](https://devforum.zoom.us/t/user-videos-not-rendering-sometimes-in-gallery-mode-video-component/93132/1 "2023-08-08T21:21:53Z")

</div>

In gallery mode (video component)… there are times where someone’s video doesn’t get rendered. It’s very hit or miss and random… it does seem to happen more often after someone shares their screen.

We’re using mostly the default code. Is there any advice on what I can do to prevent this from happening? We really want to use this for our production site but it’s been buggy in that aspect despite the code below and the screen shots showing that it is indeed rendering each user.

```auto
useEffect(() => {
    if (
      // previousIsVideoDecodeReady === false &&
      isVideoDecodeReady === true &&
      subscribedVideos.length > 0
    ) {
      console.group("client all users");
      zmClient.getAllUser().forEach((user) => {
        console.log(user);
      })
      console.groupEnd();
      subscribedVideos.forEach(async (userId) => {
        const index = participants.findIndex((user) => user.userId === userId);
        const cellDimension = layout[index];
        if (cellDimension &&(!isSkipSelfVideo ||(isSkipSelfVideo&&userId!==currentUserId))) {
          const { width, height, x, y, quality } = cellDimension;
          console.log("3333", userId, width, height, x, y);
          await mediaStream?.renderVideo(
            videoRef.current as HTMLCanvasElement,
            userId,
            width,
            height,
            x,
            y,
            quality,
          );
        }
      });
    }
  }, [
    zmClient,
    mediaStream,
    videoRef,
    layout,
    participants,
    subscribedVideos,
    isVideoDecodeReady,
    previousIsVideoDecodeReady,
    isSkipSelfVideo,
    currentUserId,
  ]);

```

 ![image](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/9/e/9eb0dbcd5ea1e02249641f46847900fc6148e0d1.jpeg)  
 ![image](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/3/6/3618baf0c1fd6be84b6b3d76d727e45d9f0bee48.png)

---

<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:** [August 9, 2023, 1:35am UTC](https://devforum.zoom.us/t/user-videos-not-rendering-sometimes-in-gallery-mode-video-component/93132/2 "2023-08-09T01:35:13Z")

</div>

Hey @DaleAtMarvin

Thanks for your feedback.

Did you do anything before the issue occurred?

Was the video rendered eventually if you waited a little longer?

Are there any errors on the console when the issue occurs?

Thanks  
Vic

---

<div class="post-metadata">

**Author:** ![DaleAtMarvin](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/daleatmarvin/32/50392_2.png) [@DaleAtMarvin](https://devforum.zoom.us/u/DaleAtMarvin)\
**Post date:** [August 9, 2023, 1:37am UTC](https://devforum.zoom.us/t/user-videos-not-rendering-sometimes-in-gallery-mode-video-component/93132/3 "2023-08-09T01:37:07Z")

</div>

yes it’s usually after or during a shared screen session.

no the video never gets rendered eventually.

no errors in the console unfortunately.

---

<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:** [August 9, 2023, 8:41am UTC](https://devforum.zoom.us/t/user-videos-not-rendering-sometimes-in-gallery-mode-video-component/93132/4 "2023-08-09T08:41:05Z")

</div>

Hey @DaleAtMarvin

Did you enable `SharedArrayBuffer` on your site?

Could you try it on our sample app?

> **[GitHub - zoom/videosdk-web-sample: Zoom Video SDK web sample](https://github.com/zoom/videosdk-web-sample)**
>
> Zoom Video SDK web sample. Contribute to zoom/videosdk-web-sample development by creating an account on GitHub.

Thanks  
Vic

---

<div class="post-metadata">

**Author:** ![DaleAtMarvin](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/daleatmarvin/32/50392_2.png) [@DaleAtMarvin](https://devforum.zoom.us/u/DaleAtMarvin)\
**Post date:** [August 9, 2023, 8:43am UTC](https://devforum.zoom.us/t/user-videos-not-rendering-sometimes-in-gallery-mode-video-component/93132/5 "2023-08-09T08:43:05Z")

</div>

hey vic. SharedArrayBuffer is enabled and we’re using most of the base code from the sample app… it’s hard to replicate but it happens enough… i’ll see if i can get the team to play around with the exact default app and get it to happen again

---

<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:** [August 9, 2023, 9:07am UTC](https://devforum.zoom.us/t/user-videos-not-rendering-sometimes-in-gallery-mode-video-component/93132/6 "2023-08-09T09:07:54Z")

</div>

Hey @DaleAtMarvin

Thanks for sharing the information with us.

We tried several times on the sample app but failed to reproduce. So it’s very helpful to get the reproduce steps for investigating the issue.

Thanks  
Vic
