# Video-single.tsx display active user and myself

**URL:** <https://devforum.zoom.us/t/video-single-tsx-display-active-user-and-myself/68584>\
**Category:** Web\
**Created:** [May 6, 2022, 3:29am UTC](https://devforum.zoom.us/t/video-single-tsx-display-active-user-and-myself/68584 "2022-05-06T03:29:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![thanh.huynh](https://avatars.discourse-cdn.com/v4/letter/t/74df32/32.png) [@thanh.huynh](https://devforum.zoom.us/u/thanh.huynh)\
**Post date:** [May 6, 2022, 3:29am UTC](https://devforum.zoom.us/t/video-single-tsx-display-active-user-and-myself/68584/1 "2022-05-06T03:29:07Z")

</div>

I want to display the video of another active user (only 1 user) in the big canvas  
And I also want to display myself in another small canvas outside the big canvas  
How can I do that?

---

<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 6, 2022, 6:36am UTC](https://devforum.zoom.us/t/video-single-tsx-display-active-user-and-myself/68584/2 "2022-05-06T06:36:55Z")

</div>

Hey @thanh.huynh

Thanks for your feedback.

You can use two canvases to render the videos. Our sample app doesn’t provide these codes, I will show you my ways:

```nohighlight
<div class="self">
  <canvas id="self-view-canvas" width="1920" height="1080"></canvas>
</div>
<div class="participant">
  <canvas id="participant-canvas" width="1920" height="1080"></canvas>
</div>

```

```javascript
// render participant's video
zmClient.on('peer-video-state-change', (payload) => {
  if(payload.action === 'Start') {
    zmStream.renderVideo(document.querySelector('#participant-canvas'), payload.userId, 1920, 1080, 0, 0, 3)
  } else if(payload.action === 'Stop') {
    zmStream.stopRenderVideo(document.querySelector('#participant-canvas'), payload.userId);
  }
})
// render self video
// following statement should be in the event callback
zmStream.startVideo().then(() => {
  zmStream.renderVideo(document.querySelector('#self-view-canvas'), zmClient.getCurrentUserInfo().userId, 1920, 1080, 0, 0, 3)
})

```

Thanks  
Vic

---

<div class="post-metadata">

**Author:** ![thanh.huynh](https://avatars.discourse-cdn.com/v4/letter/t/74df32/32.png) [@thanh.huynh](https://devforum.zoom.us/u/thanh.huynh)\
**Post date:** [May 6, 2022, 7:03am UTC](https://devforum.zoom.us/t/video-single-tsx-display-active-user-and-myself/68584/3 "2022-05-06T07:03:59Z")

</div>

OK it should work  
Thank you

---

<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:** [June 5, 2022, 5:04pm UTC](https://devforum.zoom.us/t/video-single-tsx-display-active-user-and-myself/68584/4 "2022-06-05T17:04:40Z")

</div>

Closed on June 5, 2022, 5:04pm UTC

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