# Question about creating and rendering a participant canvas

**URL:** <https://devforum.zoom.us/t/question-about-creating-and-rendering-a-participant-canvas/56245>\
**Category:** Web\
**Created:** [August 23, 2021, 6:17am UTC](https://devforum.zoom.us/t/question-about-creating-and-rendering-a-participant-canvas/56245 "2021-08-23T06:17:53Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Deneb](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/deneb/32/29355_2.png) [@Deneb](https://devforum.zoom.us/u/Deneb)\
**Post date:** [August 23, 2021, 6:17am UTC](https://devforum.zoom.us/t/question-about-creating-and-rendering-a-participant-canvas/56245/1 "2021-08-23T06:17:53Z")

</div>

**Description**  
Currently, all participants’ videos are being rendered on one canvas.

**Which Web Video SDK version?**  
1.1.3

**Additional context**  
At first, the canvas was created through the participant array rendering and rendered by giving the participant userId as an id value to the canvas, but the re-rendering and the phenomenon that the rendered camera image stops when the 2nd participant out of the 3 users leaves is repeated. . Currently, the participant’s videos are superimposed on one canvas.  
I want to render the component that is created every time a participant comes in. Is there a better way than assigning the userId to the corresponding canvas id value? I’ve seen the sample app, but I’m getting my understanding wrong.  
I’m still inexperienced, so I hope you can help.

---

<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 23, 2021, 8:18am UTC](https://devforum.zoom.us/t/question-about-creating-and-rendering-a-participant-canvas/56245/2 "2021-08-23T08:18:24Z")

</div>

Hey @Deneb

Thanks for your feedback.

What’s your concern about video rendering? The dimension and position of the video depending on the parameters of `stream.renderVideo`. We suggest using a single canvas to hold these videos.

As the way of the sample app does, an array of participants serve as the state of videos. Listen to the `user-added`, `user-updated` and `user-removed` events to obtain participants’ video status. Then figure out the layout of each video cell. Finally, invoke the `stream.renderVideo` method to draw the video.

Thanks  
Vic

---

<div class="post-metadata">

**Author:** ![Deneb](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/deneb/32/29355_2.png) [@Deneb](https://devforum.zoom.us/u/Deneb)\
**Post date:** [August 23, 2021, 8:24am UTC](https://devforum.zoom.us/t/question-about-creating-and-rendering-a-participant-canvas/56245/3 "2021-08-23T08:24:12Z")

</div>

Thank you very much for your reply. Are you saying that you need to output video of multiple participants in one canvas?  
In the first attempt, the screens of several participants overlapped on one canvas, so I assigned each canvas as userId. After hearing the answers, I found the correct way. Is there a guideline source that divides the participant’s screen into one canvas? I’ve been looking for it, but I can’t find it

---

<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:** [August 23, 2021, 7:43pm UTC](https://devforum.zoom.us/t/question-about-creating-and-rendering-a-participant-canvas/56245/4 "2021-08-23T19:43:34Z")

</div>

Hey @Deneb ,

Happy to hear you found the correct way! 🙂

> [@Deneb](#):
>
> Is there a guideline source that divides the participant’s screen into one canvas? I’ve been looking for it, but I can’t find it

Yes! We have a great example of gallery view on our Video SDK 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.

> <https://github.com/zoom/videosdk-web-sample/blob/master/react-demo/src/feature/video/hooks/useGalleryLayout.ts>

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![Deneb](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/deneb/32/29355_2.png) [@Deneb](https://devforum.zoom.us/u/Deneb)\
**Post date:** [August 24, 2021, 12:18am UTC](https://devforum.zoom.us/t/question-about-creating-and-rendering-a-participant-canvas/56245/5 "2021-08-24T00:18:14Z")

</div>

thank you. May your day be full of good things 😊😊

---

<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:** [August 24, 2021, 6:56pm UTC](https://devforum.zoom.us/t/question-about-creating-and-rendering-a-participant-canvas/56245/7 "2021-08-24T18:56:36Z")

</div>

Happy to help! 🙂

-Tommy

---

<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:** [September 24, 2021, 4:57am UTC](https://devforum.zoom.us/t/question-about-creating-and-rendering-a-participant-canvas/56245/8 "2021-09-24T04:57:35Z")

</div>

Closed on September 24, 2021, 4:57am UTC

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