# Video WEB SDK participant video is overlapping

**URL:** <https://devforum.zoom.us/t/video-web-sdk-participant-video-is-overlapping/110107>\
**Category:** Video SDK\
**Tags:** video-sdk\
**Created:** [May 16, 2024, 1:41pm UTC](https://devforum.zoom.us/t/video-web-sdk-participant-video-is-overlapping/110107 "2024-05-16T13:41:50Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![vinaykumar.t](https://avatars.discourse-cdn.com/v4/letter/v/59ef9b/32.png) [@vinaykumar.t](https://devforum.zoom.us/u/vinaykumar.t)\
**Post date:** [May 16, 2024, 1:41pm UTC](https://devforum.zoom.us/t/video-web-sdk-participant-video-is-overlapping/110107/1 "2024-05-16T13:41:50Z")

</div>

Hello Zoom Support Team,

We are currently utilizing Zoom Video SDK 1.10.8 within our application, and we have encountered an issue that we would appreciate your assistance with.

Following the guidelines provided, we have implemented a single HTML canvas rendering approach. Specifically, we have configured the system to display the video stream of the participant who is speaking using the following code snippet:

```auto

stream.renderVideo(
document.querySelector('#participant-videos-canvas'),
payload.userId, 1920, 1080, 0, 0, 3
);

```

```auto
this.stream.stopRenderVideo(
                                document.querySelector('#participants-canvas'),
                                this.oldActiveUserId
                            );
this.stream.renderVideo(
                                document.querySelector('#participants-canvas'),
                                payload[0].userId,1920,1080,0,0,3);

```

Additionally, we are correctly invoking `stopRenderVideo` for the previously active user. Despite adhering to these practices, we are experiencing difficulties when users join from mobile devices.

We kindly request your guidance and support in resolving this issue. Any insights or recommendations you can provide would be greatly appreciated.

Thank you for your attention to this matter.

Sincerely,  
Vinay Thakkar

I’m trying to upload an image for more reference, but it’s showing me this error message.  
**An error occurred: Sorry, you can’t embed media items in a post.**

---

<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:** [May 17, 2024, 3:31am UTC](https://devforum.zoom.us/t/video-web-sdk-participant-video-is-overlapping/110107/2 "2024-05-17T03:31:26Z")

</div>

Hey @vinaykumar.t

Thanks for your feedback.

Could you share the session ID that’s experiencing issues with us for troubleshooting purposes?

Thanks  
Vic

---

<div class="post-metadata">

**Author:** ![vinaykumar.t](https://avatars.discourse-cdn.com/v4/letter/v/59ef9b/32.png) [@vinaykumar.t](https://devforum.zoom.us/u/vinaykumar.t)\
**Post date:** [May 17, 2024, 7:40am UTC](https://devforum.zoom.us/t/video-web-sdk-participant-video-is-overlapping/110107/3 "2024-05-17T07:40:40Z")

</div>

Hi @vic.yang

I appreciate your response.

The session information is attached.

Session ID: +dY4ljR6TyOmqwWVey1uuA==  
Session Name: 414db2c5-46eb-4906-be0d-16e7058ef0fc

If you require more information, please let me know.

Thanks,  
Vinay Thakkar

---

<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:** [May 20, 2024, 8:02am UTC](https://devforum.zoom.us/t/video-web-sdk-participant-video-is-overlapping/110107/4 "2024-05-20T08:02:36Z")

</div>

Hey @vinaykumar.t

Are you rendering the active video on the same canvas? This is feasible, but several factors need to be considered:

- If the active video is self-view and `stream.isRenderSelfViewWithVideoElement()` returns `true`, you need to use the video tag to render the self-video.

- When listening to and handling the `video-active-change` event, pay attention to the `state` property in the payload. You can only render the video when the state is `Active`.

- Be sure to stop rendering the old video before rendering a new one to avoid video overlap issues.

Here is a simple pseudocode example:

```javascript
let activeVideoId = 0;
client.on("video-active-change", async (payload) => {
  const { state, userId } = payload;
  if (state === "Active") {
    if (activeVideoId !== userId) {
      // stop rendering the previous video first
      if (activeVideoId) {
        await stream.stopRenderVideo(canvas, activeVideoId);
      }
      await stream.renderVideo(
        canvas,
        userId,
        1280,
        720,
        0,
        0,
        VideoQuality.Video_720P
      );
    }
    activeVideoId = userId;
  } else {
    // No active video, stop rendering the previous video
    await stream.stopRenderVideo(canvas, activeVideoId);
    activeVideoId = 0;
  }
});

```

Thanks  
Vic

---

<div class="post-metadata">

**Author:** ![vinaykumar.t](https://avatars.discourse-cdn.com/v4/letter/v/59ef9b/32.png) [@vinaykumar.t](https://devforum.zoom.us/u/vinaykumar.t)\
**Post date:** [May 20, 2024, 2:28pm UTC](https://devforum.zoom.us/t/video-web-sdk-participant-video-is-overlapping/110107/5 "2024-05-20T14:28:39Z")

</div>

Thanks,@vic.yang!

The solution works perfectly for me. I appreciate the support.

---

<div class="post-metadata">

**Author:** ![vinaykumar.t](https://avatars.discourse-cdn.com/v4/letter/v/59ef9b/32.png) [@vinaykumar.t](https://devforum.zoom.us/u/vinaykumar.t)\
**Post date:** [May 21, 2024, 10:25am UTC](https://devforum.zoom.us/t/video-web-sdk-participant-video-is-overlapping/110107/6 "2024-05-21T10:25:55Z")

</div>

Hi, @vic.yang

Thanks for helping. I have one last question.  
Is there a way to stop rendering video for every user in the stream?  
like  
` await stream.stopRenderVideo(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:** [May 22, 2024, 5:41am UTC](https://devforum.zoom.us/t/video-web-sdk-participant-video-is-overlapping/110107/7 "2024-05-22T05:41:09Z")

</div>

Hey @vinaykumar.t

> Is there a way to stop rendering video for every user in the stream?

Currently, there is no straightforward way to stop rendering all videos directly. You can stop them one by one using the `stream.stopRenderVideo` method.

Thanks  
Vic

---

<div class="post-metadata">

**Author:** ![vinaykumar.t](https://avatars.discourse-cdn.com/v4/letter/v/59ef9b/32.png) [@vinaykumar.t](https://devforum.zoom.us/u/vinaykumar.t)\
**Post date:** [May 22, 2024, 6:37am UTC](https://devforum.zoom.us/t/video-web-sdk-participant-video-is-overlapping/110107/8 "2024-05-22T06:37:30Z")

</div>

Hi @vic.yang ,

Thanks for the update,

**Feedback :**  
The Zoom team should consider adding this feature to stop rendering video for every user in the stream. Having that would be very helpful in many ways.

Thanks,  
Vinay Thakkar

---

<div class="post-metadata">

**Author:** ![maxmaxlopin](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/maxmaxlopin/32/63207_2.png) [@maxmaxlopin](https://devforum.zoom.us/u/maxmaxlopin)\
**Post date:** [September 10, 2024, 4:56pm UTC](https://devforum.zoom.us/t/video-web-sdk-participant-video-is-overlapping/110107/9 "2024-09-10T16:56:30Z")

</div>

To fix overlapping participant videos in your Video WEB SDK, try adjusting the layout settings or check for CSS conflicts that may be causing the issue.
